Example: SRC_URI = "http://www.craplinktech.com/?downloads=veryveryverylonghash;filename=blah.zip"
will download the archive and save it as blah.zip. Signed-off-by: Petr Štetiar <[email protected]> --- lib/bb/fetch/wget.py | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/bb/fetch/wget.py b/lib/bb/fetch/wget.py index 4d4bdfd..f5168c1 100644 --- a/lib/bb/fetch/wget.py +++ b/lib/bb/fetch/wget.py @@ -43,9 +43,12 @@ class Wget(Fetch): def localpath(self, url, ud, d): url = encodeurl([ud.type, ud.host, ud.path, ud.user, ud.pswd, {}]) - ud.basename = os.path.basename(ud.path) - ud.localfile = data.expand(urllib.unquote(ud.basename), d) + if 'filename' in ud.parm: + ud.basename = ud.parm['filename'] + else: + ud.basename = os.path.basename(ud.path) + ud.localfile = data.expand(ud.basename, d) return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile) def go(self, uri, ud, d, checkonly = False): @@ -65,6 +68,9 @@ class Wget(Fetch): uri_type = uri_decoded[0] uri_host = uri_decoded[1] + if 'filename' in ud.parm: + fetchcmd = fetchcmd + " --output-document=" + ud.localfile + " " + fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0]) fetchcmd = fetchcmd.replace("${FILE}", ud.basename) logger.info("fetch " + uri) -- 1.7.0.4 _______________________________________________ Bitbake-dev mailing list [email protected] https://lists.berlios.de/mailman/listinfo/bitbake-dev
