summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-28 17:25:21 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-02 17:25:29 +0000
commit5f0e3a8800b1939fa9573ddef8a279140c91ec3c (patch)
tree0f6a87ac441099a64a7d2e39a32d47a8158cd0ee /bitbake
parent6265744ec579081f6abcf60390c650728157ae54 (diff)
downloadpoky-5f0e3a8800b1939fa9573ddef8a279140c91ec3c.tar.gz
bitbake: fetch/wget: Start to clean up command construction
Start to clean up wget fetcher command construction to allow clearer and more extensible code structure. Drops support for ${URI} and ${FILE} directly in the commands. (Bitbake rev: 4e59fe45be2088996abc21e9a631a32b9a9642c9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/wget.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index e2f99ce3e3..bb686b52db 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -58,28 +58,27 @@ class Wget(FetchMethod):
58 58
59 ud.localfile = data.expand(urllib.unquote(ud.basename), d) 59 ud.localfile = data.expand(urllib.unquote(ud.basename), d)
60 60
61 self.basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate"
62
61 def download(self, ud, d, checkonly = False): 63 def download(self, ud, d, checkonly = False):
62 """Fetch urls""" 64 """Fetch urls"""
63 65
64 basecmd = d.getVar("FETCHCMD_wget", True) or "/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate" 66 fetchcmd = self.basecmd
65 67
66 if not checkonly and 'downloadfilename' in ud.parm: 68 if not checkonly and 'downloadfilename' in ud.parm:
67 dldir = d.getVar("DL_DIR", True) 69 dldir = d.getVar("DL_DIR", True)
68 bb.utils.mkdirhier(os.path.dirname(dldir + os.sep + ud.localfile)) 70 bb.utils.mkdirhier(os.path.dirname(dldir + os.sep + ud.localfile))
69 basecmd += " -O " + dldir + os.sep + ud.localfile 71 fetchcmd += " -O " + dldir + os.sep + ud.localfile
70 72
73 uri = ud.url.split(";")[0]
71 if checkonly: 74 if checkonly:
72 fetchcmd = d.expand(basecmd + " --spider '${URI}'") 75 fetchcmd = self.basecmd + " --spider '%s'" % uri
73 elif os.path.exists(ud.localpath): 76 elif os.path.exists(ud.localpath):
74 # file exists, but we didnt complete it.. trying again.. 77 # file exists, but we didnt complete it.. trying again..
75 fetchcmd = d.expand(basecmd + " -c -P ${DL_DIR} '${URI}'") 78 fetchcmd = self.basecmd + d.expand(" -c -P ${DL_DIR} '%s'" % uri)
76 else: 79 else:
77 fetchcmd = d.expand(basecmd + " -P ${DL_DIR} '${URI}'") 80 fetchcmd = self.basecmd + d.expand(" -P ${DL_DIR} '%s'" % uri)
78
79 uri = ud.url.split(";")[0]
80 81
81 fetchcmd = fetchcmd.replace("${URI}", uri.split(";")[0])
82 fetchcmd = fetchcmd.replace("${FILE}", ud.basename)
83 if not checkonly: 82 if not checkonly:
84 logger.info("fetch " + uri) 83 logger.info("fetch " + uri)
85 logger.debug(2, "executing " + fetchcmd) 84 logger.debug(2, "executing " + fetchcmd)