summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-08 12:44:06 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-10 23:37:17 +0000
commit76e999c59875214e6eca4a57b5d34b983821aef8 (patch)
tree4d8e60e7b92009f74cb4b11e04c6b114d05dd3c2 /lib/bb/fetch2/__init__.py
parent71fe2b3c196c63f866c832b97238af7525ced249 (diff)
downloadbitbake-76e999c59875214e6eca4a57b5d34b983821aef8.tar.gz
bitbake/fetch2: When using BB_FETCH_PREMIRRORONLY, set BB_NO_NETWORK after premirrors as there could be data processing needed by the real fetcher
(From Poky rev: c4e66a7fe0c314b843aac6340995c584ec156529) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/__init__.py')
-rw-r--r--lib/bb/fetch2/__init__.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 89f5930b7..bfc0e2832 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -843,19 +843,21 @@ class Fetch(object):
os.symlink(mirrorpath, os.path.join(self.d.getVar("DL_DIR", True), os.path.basename(mirrorpath)))
if bb.data.getVar("BB_FETCH_PREMIRRORONLY", self.d, True) is None:
- if not localpath and m.need_update(u, ud, self.d):
- try:
- m.download(u, ud, self.d)
- if hasattr(m, "build_mirror_data"):
- m.build_mirror_data(u, ud, self.d)
- localpath = ud.localpath
-
- except BBFetchException:
- # Remove any incomplete fetch
- if os.path.isfile(ud.localpath):
- bb.utils.remove(ud.localpath)
- mirrors = mirror_from_string(bb.data.getVar('MIRRORS', self.d, True))
- localpath = try_mirrors (self.d, ud, mirrors)
+ bb.data.setVar("BB_NO_NETWORK", "1", self.d)
+
+ if not localpath and m.need_update(u, ud, self.d):
+ try:
+ m.download(u, ud, self.d)
+ if hasattr(m, "build_mirror_data"):
+ m.build_mirror_data(u, ud, self.d)
+ localpath = ud.localpath
+
+ except BBFetchException:
+ # Remove any incomplete fetch
+ if os.path.isfile(ud.localpath):
+ bb.utils.remove(ud.localpath)
+ mirrors = mirror_from_string(bb.data.getVar('MIRRORS', self.d, True))
+ localpath = try_mirrors (self.d, ud, mirrors)
if not localpath or not os.path.exists(localpath):
raise FetchError("Unable to fetch URL %s from any source." % u, u)