]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake/fetch2: Fix the problems introduced by the git fetcher AUTOREV fix
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 20 Apr 2011 01:13:23 +0000 (02:13 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 6 May 2011 17:13:55 +0000 (18:13 +0100)
The ordering constrains on the urldata_init functions are not straight
forward. To avoid further problems, create a helper function to setup
the source revisions which the init functions can all at the appropriate
point.

(From Poky rev: c4371138f7444ecaa1fdd2b1ee4949fbc819f886)

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

index c515a6d4a834cead4bcf1b97a9d710c0a69e7fa4..0bb3678ce4c0c7a19cb79cf53bfdd849d17e87af 100644 (file)
@@ -554,18 +554,6 @@ class FetchData(object):
         if hasattr(self.method, "urldata_init"):
             self.method.urldata_init(self, d)
 
-        if self.method.supports_srcrev():
-            self.revisions = {}
-            for name in self.names:
-                self.revisions[name] = srcrev_internal_helper(self, d, name)
-
-            # add compatibility code for non name specified case
-            if len(self.names) == 1:
-                self.revision = self.revisions[self.names[0]]
-
-        if hasattr(self.method, "fixuprevisions"):
-            self.method.fixuprevisions(self, d)
-
         if "localpath" in self.parm:
             # if user sets localpath for file, use it instead.
             self.localpath = self.parm["localpath"]
@@ -579,6 +567,15 @@ class FetchData(object):
             self.donestamp = basepath + '.done'
             self.lockfile = basepath + '.lock'
 
+    def setup_revisons(self, d):
+        self.revisions = {}
+        for name in self.names:
+            self.revisions[name] = srcrev_internal_helper(self, d, name)
+
+        # add compatibility code for non name specified case
+        if len(self.names) == 1:
+            self.revision = self.revisions[self.names[0]]
+
     def setup_localpath(self, d):
         if not self.localpath:
             self.localpath = self.method.localpath(self.url, self, d)
index 04a9087c111691e5fae21401b04a905bc34c0f49..0d10eb4a2be68c59579fe7574f37d101144966f0 100644 (file)
@@ -45,6 +45,8 @@ class Bzr(FetchMethod):
         relpath = self._strip_leading_slashes(ud.path)
         ud.pkgdir = os.path.join(data.expand('${BZRDIR}', d), ud.host, relpath)
 
+        ud.setup_revisons(d)
+
         if not ud.revision:
             ud.revision = self.latest_revision(ud.url, ud, d)
 
index 2114f2daad819bd1c4bc0846f530a706688b0de2..811acbf6c67ff8318a6fbd92652125703e334c99 100644 (file)
@@ -76,7 +76,8 @@ class Git(FetchMethod):
 
         ud.localfile = ud.clonedir
 
-def fixuprevisions(self, ud, d):
+        ud.setup_revisons(d)
+
         for name in ud.names:
             # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
             if not ud.revisions[name] or len(ud.revisions[name]) != 40  or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]):
index f2719d4f9e5134ac808cacc97734b0f8042a4f3b..793831ae0d8ec21c71c04dbad135a9ac1b73a120 100644 (file)
@@ -57,6 +57,8 @@ class Hg(FetchMethod):
         ud.pkgdir = os.path.join(data.expand('${HGDIR}', d), ud.host, relpath)
         ud.moddir = os.path.join(ud.pkgdir, ud.module)
 
+        ud.setup_revisons(d)
+
         if 'rev' in ud.parm:
             ud.revision = ud.parm['rev']
         elif not ud.revision:
index fa6c654d3e95b47fbb9f554c240ee1ba18a6be8c..59d7ccbac109ef9540d2e2e807454fc14eef95a9 100644 (file)
@@ -56,6 +56,8 @@ class Svn(FetchMethod):
         ud.pkgdir = os.path.join(data.expand('${SVNDIR}', d), ud.host, relpath)
         ud.moddir = os.path.join(ud.pkgdir, ud.module)
 
+        ud.setup_revisons(d)
+
         if 'rev' in ud.parm:
             ud.revision = ud.parm['rev']