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:35:33 +0100 |
commit | 444ad513c00fc0cecf71703101d01daae11450d9 (patch) | |
tree | 418d6273a2e3cb3646ab6da60e9cd27f8dc87168 /bitbake/lib/bb/fetch2 | |
parent | 8a978eeda0ec3daa124513b6c132bba68fdbff2b (diff) | |
download | poky-444ad513c00fc0cecf71703101d01daae11450d9.tar.gz |
bitbake: 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]
(Bitbake rev: ceb5871007f221c4d86a7bee421d4dd8d9100aaf)
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/wget.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index b784afb2e4..9affa0da5f 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py | |||
@@ -50,7 +50,11 @@ class Wget(FetchMethod): | |||
50 | 50 | ||
51 | def urldata_init(self, ud, d): | 51 | def urldata_init(self, ud, d): |
52 | 52 | ||
53 | ud.basename = os.path.basename(ud.path) | 53 | if 'downloadfilename' in ud.parm: |
54 | ud.basename = ud.parm['downloadfilename'] | ||
55 | else: | ||
56 | ud.basename = os.path.basename(ud.path) | ||
57 | |||
54 | ud.localfile = data.expand(urllib.unquote(ud.basename), d) | 58 | ud.localfile = data.expand(urllib.unquote(ud.basename), d) |
55 | 59 | ||
56 | def download(self, uri, ud, d, checkonly = False): | 60 | def download(self, uri, ud, d, checkonly = False): |
@@ -58,6 +62,9 @@ class Wget(FetchMethod): | |||
58 | 62 | ||
59 | basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate" | 63 | basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate" |
60 | 64 | ||
65 | if 'downloadfilename' in ud.parm: | ||
66 | basecmd += " -O ${DL_DIR}/" + ud.localfile | ||
67 | |||
61 | if checkonly: | 68 | if checkonly: |
62 | fetchcmd = d.getVar("CHECKCOMMAND_wget", True) or d.expand(basecmd + " -c -P ${DL_DIR} '${URI}'") | 69 | fetchcmd = d.getVar("CHECKCOMMAND_wget", True) or d.expand(basecmd + " -c -P ${DL_DIR} '${URI}'") |
63 | elif os.path.exists(ud.localpath): | 70 | elif os.path.exists(ud.localpath): |