diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-11-03 23:20:15 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-11-13 12:15:21 +0000 |
commit | 483f85802a97cb9ad4d958c29458db91acc7809f (patch) | |
tree | e67948401b16ef7d75cd88857139fd2b00af26df /bitbake/lib/bb/fetch | |
parent | c2b5a617285733053f867c3fdda2179a65ccbe4c (diff) | |
download | poky-483f85802a97cb9ad4d958c29458db91acc7809f.tar.gz |
bitbake: Sync various functions with those from bitbake-dev and bitbake upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/fetch')
-rw-r--r-- | bitbake/lib/bb/fetch/__init__.py | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index 2191c284e3..429822bfa9 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py | |||
@@ -485,21 +485,26 @@ class Fetch(object): | |||
485 | if pn: | 485 | if pn: |
486 | src_tarball_stash = (data.getVar('SRC_TARBALL_STASH_%s' % pn, d, True) or data.getVar('CVS_TARBALL_STASH_%s' % pn, d, True) or data.getVar('SRC_TARBALL_STASH', d, True) or data.getVar('CVS_TARBALL_STASH', d, True) or "").split() | 486 | src_tarball_stash = (data.getVar('SRC_TARBALL_STASH_%s' % pn, d, True) or data.getVar('CVS_TARBALL_STASH_%s' % pn, d, True) or data.getVar('SRC_TARBALL_STASH', d, True) or data.getVar('CVS_TARBALL_STASH', d, True) or "").split() |
487 | 487 | ||
488 | ld = d.createCopy() | ||
488 | for stash in src_tarball_stash: | 489 | for stash in src_tarball_stash: |
489 | fetchcmd = data.getVar("FETCHCOMMAND_mirror", d, True) or data.getVar("FETCHCOMMAND_wget", d, True) | 490 | url = stash + tarfn |
490 | uri = stash + tarfn | 491 | try: |
491 | bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri) | 492 | ud = FetchData(url, ld) |
492 | fetchcmd = fetchcmd.replace("${URI}", uri) | 493 | except bb.fetch.NoMethodError: |
493 | httpproxy = data.getVar("http_proxy", d, True) | 494 | bb.msg.debug(1, bb.msg.domain.Fetcher, "No method for %s" % url) |
494 | ftpproxy = data.getVar("ftp_proxy", d, True) | 495 | continue |
495 | if httpproxy: | 496 | |
496 | fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd | 497 | ud.setup_localpath(ld) |
497 | if ftpproxy: | 498 | |
498 | fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd | 499 | try: |
499 | ret = os.system(fetchcmd) | 500 | ud.method.go(url, ud, ld) |
500 | if ret == 0: | ||
501 | bb.msg.note(1, bb.msg.domain.Fetcher, "Fetched %s from tarball stash, skipping checkout" % tarfn) | ||
502 | return True | 501 | return True |
502 | except (bb.fetch.MissingParameterError, | ||
503 | bb.fetch.FetchError, | ||
504 | bb.fetch.MD5SumError): | ||
505 | import sys | ||
506 | (type, value, traceback) = sys.exc_info() | ||
507 | bb.msg.debug(2, bb.msg.domain.Fetcher, "Tarball stash fetch failure: %s" % value) | ||
503 | return False | 508 | return False |
504 | try_mirror = staticmethod(try_mirror) | 509 | try_mirror = staticmethod(try_mirror) |
505 | 510 | ||