]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake/fetch: ensure the go() method completes when not using premirrors
authorJoshua Lock <josh@linux.intel.com>
Thu, 9 Sep 2010 16:29:23 +0000 (17:29 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 10 Sep 2010 17:36:35 +0000 (18:36 +0100)
Signed-off-by: Joshua Lock <josh@linux.intel.com>
bitbake/lib/bb/fetch/__init__.py

index d0931ec9c387c7147395a4a98d78b0a82c924b6a..e04c3df33562b144d65cb5014fe9a6353fe652eb 100644 (file)
@@ -234,8 +234,12 @@ def go(d, urls = None):
     for u in urls:
         ud = urldata[u]
         m = ud.method
+        premirror_fetch = True
+        localpath = ""
+
         if ud.localfile:
             if not m.try_premirror(u, ud, d):
+                premirror_fetch = False
                 # File already present along with md5 stamp file
                 # Touch md5 file to show activity
                 try:
@@ -243,9 +247,10 @@ def go(d, urls = None):
                 except:
                     # Errors aren't fatal here
                     pass
-                continue
+
             lf = bb.utils.lockfile(ud.lockfile)
             if not m.try_premirror(u, ud, d):
+                premirror_fetch = False
                 # If someone else fetched this before we got the lock,
                 # notice and don't try again
                 try:
@@ -253,12 +258,11 @@ def go(d, urls = None):
                 except:
                     # Errors aren't fatal here
                     pass
-                bb.utils.unlockfile(lf)
-                continue
 
-        # First try fetching uri, u, from PREMIRRORS
-        mirrors = [ i.split() for i in (bb.data.getVar('PREMIRRORS', d, 1) or "").split('\n') if i ]
-        localpath = try_mirrors(d, u, mirrors, False, m.forcefetch(u, ud, d))
+        if premirror_fetch:
+            # First try fetching uri, u, from PREMIRRORS
+            mirrors = [ i.split() for i in (bb.data.getVar('PREMIRRORS', d, 1) or "").split('\n') if i ]
+            localpath = try_mirrors(d, u, mirrors, False, m.forcefetch(u, ud, d))
 
         # Need to re-test forcefetch() which will return true if our copy is too old
         if m.forcefetch(u, ud, d) or not localpath: