]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
fetch2: Fix AUTOINC handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 Jun 2013 17:10:36 +0000 (18:10 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 12 Jun 2013 12:15:12 +0000 (13:15 +0100)
AUTOINC was meant to appear once at the start of the version string.
The list of names may not be sorted meaning it could get inserted in
the middle. This patch simplifies the code and ensures it appears at
the start.

Include cache version bump to ensure the cache picks up these changes.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/cache.py
lib/bb/fetch2/__init__.py

index eee83b7d09c858d57f2c81a26f9931132bda34c0..fb0f40c602f5d7d68a2376f3d2e6886b8f716c59 100644 (file)
@@ -43,7 +43,7 @@ except ImportError:
     logger.info("Importing cPickle failed. "
                 "Falling back to a very slow implementation.")
 
-__cache_version__ = "145"
+__cache_version__ = "146"
 
 def getCacheFile(path, filename, data_hash):
     return os.path.join(path, filename + "." + data_hash)
index 1988dc760d059e861045f135233dd72f197c0154..1365335330d95fb8b31e90125da2315d6a79cc70 100644 (file)
@@ -638,12 +638,12 @@ def get_srcrev(d):
         ud = urldata[scm]
         for name in ud.names:
             autoinc, rev = ud.method.sortable_revision(scm, ud, d, name)
+            seenautoinc = seenautoinc or autoinc
             if len(rev) > 10:
                 rev = rev[:10]
-            if autoinc and not seenautoinc:
-                rev = "AUTOINC+" + rev
-                seenautoinc = True
             format = format.replace(name, rev)
+    if seenautoinc:
+       format = "AUTOINC+" + format
 
     return format