diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-10-17 20:11:27 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-10-17 20:11:27 +0100 |
commit | 627d9b1bde25422ccde4e313ee3c954b5c9b2932 (patch) | |
tree | 3bdf252f71ed0a1155bef212fbf8c7415bdc2788 /bitbake-dev/lib/bb/fetch | |
parent | f1216d2adbb0371deedec3a5060f377e8eb65d64 (diff) | |
download | openembedded-core-627d9b1bde25422ccde4e313ee3c954b5c9b2932.tar.gz openembedded-core-627d9b1bde25422ccde4e313ee3c954b5c9b2932.tar.bz2 openembedded-core-627d9b1bde25422ccde4e313ee3c954b5c9b2932.tar.xz openembedded-core-627d9b1bde25422ccde4e313ee3c954b5c9b2932.zip |
bitbake-dev: Sync with changes upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake-dev/lib/bb/fetch')
-rw-r--r-- | bitbake-dev/lib/bb/fetch/__init__.py | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/bitbake-dev/lib/bb/fetch/__init__.py b/bitbake-dev/lib/bb/fetch/__init__.py index 2191c284e..429822bfa 100644 --- a/bitbake-dev/lib/bb/fetch/__init__.py +++ b/bitbake-dev/lib/bb/fetch/__init__.py @@ -485,21 +485,26 @@ class Fetch(object): if pn: 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() + ld = d.createCopy() for stash in src_tarball_stash: - fetchcmd = data.getVar("FETCHCOMMAND_mirror", d, True) or data.getVar("FETCHCOMMAND_wget", d, True) - uri = stash + tarfn - bb.msg.note(1, bb.msg.domain.Fetcher, "fetch " + uri) - fetchcmd = fetchcmd.replace("${URI}", uri) - httpproxy = data.getVar("http_proxy", d, True) - ftpproxy = data.getVar("ftp_proxy", d, True) - if httpproxy: - fetchcmd = "http_proxy=" + httpproxy + " " + fetchcmd - if ftpproxy: - fetchcmd = "ftp_proxy=" + ftpproxy + " " + fetchcmd - ret = os.system(fetchcmd) - if ret == 0: - bb.msg.note(1, bb.msg.domain.Fetcher, "Fetched %s from tarball stash, skipping checkout" % tarfn) + url = stash + tarfn + try: + ud = FetchData(url, ld) + except bb.fetch.NoMethodError: + bb.msg.debug(1, bb.msg.domain.Fetcher, "No method for %s" % url) + continue + + ud.setup_localpath(ld) + + try: + ud.method.go(url, ud, ld) return True + except (bb.fetch.MissingParameterError, + bb.fetch.FetchError, + bb.fetch.MD5SumError): + import sys + (type, value, traceback) = sys.exc_info() + bb.msg.debug(2, bb.msg.domain.Fetcher, "Tarball stash fetch failure: %s" % value) return False try_mirror = staticmethod(try_mirror) |