]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake/fetch: ensure the mirrored repository is updated as required
authorJoshua Lock <josh@linux.intel.com>
Fri, 27 Aug 2010 14:52:08 +0000 (15:52 +0100)
committerJoshua Lock <josh@linux.intel.com>
Wed, 1 Sep 2010 10:14:57 +0000 (11:14 +0100)
If we fetch a tarball from a mirror it's entirely possible that the
mirror will have been from before the required tag/branch/etc was included
in the repository. To that end use forcefetch() as a way of testing whether
the repository is up to date and if not fetch updates.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
bitbake/lib/bb/fetch/__init__.py

index ab097dda53f060e77f2c2a9c4a13cfdb6bd8d28c..9a99b346b310ebf1fad932a398b704d8e7e9b157 100644 (file)
@@ -259,7 +259,9 @@ def go(d, urls = None):
         # 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 not localpath:
+
+        # Need to re-test forcefetch() which will return true if our copy is too old
+        if m.forcefetch(u, ud, d) or not localpath:
             # Next try fetching from the original uri, u
             try:
                 m.go(u, ud, d)