diff options
author | Nitin A Kamble <nitin.a.kamble@intel.com> | 2012-07-18 17:39:18 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-24 10:34:46 +0100 |
commit | ceb5871007f221c4d86a7bee421d4dd8d9100aaf (patch) | |
tree | bc5b5bd553687d70377bf2dda5d0de989b4b79ae /lib/bb | |
parent | 877a04d0b3cea9d5dbdf3c54fe0feb54cb997dda (diff) | |
download | bitbake-ceb5871007f221c4d86a7bee421d4dd8d9100aaf.tar.gz |
bitbake wget fetcher: add parameter: downloadfilename
this allows wget fetcher to store the downloaded file in a specified custom filename in ${DL_DIR}
Exmaple:
SRC_URI = "https://edc.intel.com/Download.aspx?id=6190;downloadfilename=LIN_IEMGD_1_14_GOLD_2443.tgz"
This fixes bug:
[YOCTO #2570]
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb')
-rw-r--r-- | lib/bb/fetch2/wget.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py index b784afb2e..9affa0da5 100644 --- a/lib/bb/fetch2/wget.py +++ b/lib/bb/fetch2/wget.py @@ -50,7 +50,11 @@ class Wget(FetchMethod): def urldata_init(self, ud, d): - ud.basename = os.path.basename(ud.path) + if 'downloadfilename' in ud.parm: + ud.basename = ud.parm['downloadfilename'] + else: + ud.basename = os.path.basename(ud.path) + ud.localfile = data.expand(urllib.unquote(ud.basename), d) def download(self, uri, ud, d, checkonly = False): @@ -58,6 +62,9 @@ class Wget(FetchMethod): basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate" + if 'downloadfilename' in ud.parm: + basecmd += " -O ${DL_DIR}/" + ud.localfile + if checkonly: fetchcmd = d.getVar("CHECKCOMMAND_wget", True) or d.expand(basecmd + " -c -P ${DL_DIR} '${URI}'") elif os.path.exists(ud.localpath): |