浏览代码

bitbake: fetch2: Fix AUTOINC handling

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.

(Bitbake rev: ad8bf10d873abb94d987860a3f6d06b134fb8a99)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie 12 年之前
父节点
当前提交
cd7b7de91a
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 1 1
      bitbake/lib/bb/cache.py
  2. 3 3
      bitbake/lib/bb/fetch2/__init__.py

+ 1 - 1
bitbake/lib/bb/cache.py

@@ -43,7 +43,7 @@ except ImportError:
     logger.info("Importing cPickle failed. "
     logger.info("Importing cPickle failed. "
                 "Falling back to a very slow implementation.")
                 "Falling back to a very slow implementation.")
 
 
-__cache_version__ = "145"
+__cache_version__ = "146"
 
 
 def getCacheFile(path, filename, data_hash):
 def getCacheFile(path, filename, data_hash):
     return os.path.join(path, filename + "." + data_hash)
     return os.path.join(path, filename + "." + data_hash)

+ 3 - 3
bitbake/lib/bb/fetch2/__init__.py

@@ -638,12 +638,12 @@ def get_srcrev(d):
         ud = urldata[scm]
         ud = urldata[scm]
         for name in ud.names:
         for name in ud.names:
             autoinc, rev = ud.method.sortable_revision(scm, ud, d, name)
             autoinc, rev = ud.method.sortable_revision(scm, ud, d, name)
+            seenautoinc = seenautoinc or autoinc
             if len(rev) > 10:
             if len(rev) > 10:
                 rev = rev[:10]
                 rev = rev[:10]
-            if autoinc and not seenautoinc:
-                rev = "AUTOINC+" + rev
-                seenautoinc = True
             format = format.replace(name, rev)
             format = format.replace(name, rev)
+    if seenautoinc:
+       format = "AUTOINC+" + format
 
 
     return format
     return format