diff options
Diffstat (limited to 'bitbake/lib/bb/fetch2')
| -rw-r--r-- | bitbake/lib/bb/fetch2/wget.py | 17 |
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) |
