diff options
author | Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com> | 2020-01-24 18:08:10 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-27 16:48:10 +0000 |
commit | b9ce68a5d7beca817d0370e89b178dbc9ff6ccbc (patch) | |
tree | aabd2c879b31d241337415eddb3aab43e00336c5 /bitbake/lib/bb/fetch2 | |
parent | c37a1bc05e51abb252f36b033a1a5889a6ca9836 (diff) | |
download | poky-b9ce68a5d7beca817d0370e89b178dbc9ff6ccbc.tar.gz |
bitbake: fetch2/wget: fix downloadfilename parameter
When using a download filename with characters which can be interpreted
by the shell ('(', ')', '&', ';', ...) the command fails. Quoting the
filename fixes the issue.
(Bitbake rev: ed652dce5200161068eccdbfaaaefde33136eb09)
Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.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 | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index 72bc6c8f4d..5235ae4d9e 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py | |||
@@ -12,6 +12,7 @@ BitBake build tools. | |||
12 | # | 12 | # |
13 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig | 13 | # Based on functions from the base bb module, Copyright 2003 Holger Schurig |
14 | 14 | ||
15 | import shlex | ||
15 | import re | 16 | import re |
16 | import tempfile | 17 | import tempfile |
17 | import os | 18 | import os |
@@ -91,9 +92,9 @@ class Wget(FetchMethod): | |||
91 | fetchcmd = self.basecmd | 92 | fetchcmd = self.basecmd |
92 | 93 | ||
93 | if 'downloadfilename' in ud.parm: | 94 | if 'downloadfilename' in ud.parm: |
94 | dldir = d.getVar("DL_DIR") | 95 | localpath = os.path.join(d.getVar("DL_DIR"), ud.localfile) |
95 | bb.utils.mkdirhier(os.path.dirname(dldir + os.sep + ud.localfile)) | 96 | bb.utils.mkdirhier(os.path.dirname(localpath)) |
96 | fetchcmd += " -O " + dldir + os.sep + ud.localfile | 97 | fetchcmd += " -O %s" % shlex.quote(localpath) |
97 | 98 | ||
98 | if ud.user and ud.pswd: | 99 | if ud.user and ud.pswd: |
99 | fetchcmd += " --user=%s --password=%s --auth-no-challenge" % (ud.user, ud.pswd) | 100 | fetchcmd += " --user=%s --password=%s --auth-no-challenge" % (ud.user, ud.pswd) |