aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-04-20 02:13:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-06 18:13:55 +0100
commit12112102dd2808534505d4bfbb171904794428c2 (patch)
tree0f14fa2484f1e17a98df5e6bde2341d5e3e53898
parenteb799b44adab4701825f3dda5d982256781d7f78 (diff)
downloadbitbake-12112102dd2808534505d4bfbb171904794428c2.tar.gz
bitbake/fetch2: Fix the problems introduced by the git fetcher AUTOREV fix
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>
-rw-r--r--lib/bb/fetch2/__init__.py21
-rw-r--r--lib/bb/fetch2/bzr.py2
-rw-r--r--lib/bb/fetch2/git.py3
-rw-r--r--lib/bb/fetch2/hg.py2
-rw-r--r--lib/bb/fetch2/svn.py2
5 files changed, 17 insertions, 13 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index c515a6d4a..0bb3678ce 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -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)
diff --git a/lib/bb/fetch2/bzr.py b/lib/bb/fetch2/bzr.py
index 04a9087c1..0d10eb4a2 100644
--- a/lib/bb/fetch2/bzr.py
+++ b/lib/bb/fetch2/bzr.py
@@ -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)
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 2114f2daa..811acbf6c 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -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]]):
diff --git a/lib/bb/fetch2/hg.py b/lib/bb/fetch2/hg.py
index f2719d4f9..793831ae0 100644
--- a/lib/bb/fetch2/hg.py
+++ b/lib/bb/fetch2/hg.py
@@ -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:
diff --git a/lib/bb/fetch2/svn.py b/lib/bb/fetch2/svn.py
index fa6c654d3..59d7ccbac 100644
--- a/lib/bb/fetch2/svn.py
+++ b/lib/bb/fetch2/svn.py
@@ -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']