summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bb/fetch2')
-rw-r--r--lib/bb/fetch2/wget.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index 72bc6c8f4..5235ae4d9 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -12,6 +12,7 @@ BitBake build tools.
#
# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+import shlex
import re
import tempfile
import os
@@ -91,9 +92,9 @@ class Wget(FetchMethod):
fetchcmd = self.basecmd
if 'downloadfilename' in ud.parm:
- dldir = d.getVar("DL_DIR")
- bb.utils.mkdirhier(os.path.dirname(dldir + os.sep + ud.localfile))
- fetchcmd += " -O " + dldir + os.sep + ud.localfile
+ localpath = os.path.join(d.getVar("DL_DIR"), ud.localfile)
+ bb.utils.mkdirhier(os.path.dirname(localpath))
+ fetchcmd += " -O %s" % shlex.quote(localpath)
if ud.user and ud.pswd:
fetchcmd += " --user=%s --password=%s --auth-no-challenge" % (ud.user, ud.pswd)