]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake/fetch2: When using BB_FETCH_PREMIRRORONLY, set BB_NO_NETWORK after premirrors...
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 8 Feb 2011 12:44:06 +0000 (12:44 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 8 Feb 2011 14:02:16 +0000 (14:02 +0000)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/fetch2/__init__.py

index 89f5930b7f8816bb141c5dc13b5540ff1718b7ff..bfc0e2832fdf4ef509ddabd094bb954544ab6a39 100644 (file)
@@ -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)