summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py21
-rw-r--r--bitbake/lib/bb/fetch2/bzr.py2
-rw-r--r--bitbake/lib/bb/fetch2/git.py3
-rw-r--r--bitbake/lib/bb/fetch2/hg.py2
-rw-r--r--bitbake/lib/bb/fetch2/svn.py2
5 files changed, 17 insertions, 13 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index f53467e73b..0bb90976e3 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -558,18 +558,6 @@ class FetchData(object):
558 if hasattr(self.method, "urldata_init"): 558 if hasattr(self.method, "urldata_init"):
559 self.method.urldata_init(self, d) 559 self.method.urldata_init(self, d)
560 560
561 if self.method.supports_srcrev():
562 self.revisions = {}
563 for name in self.names:
564 self.revisions[name] = srcrev_internal_helper(self, d, name)
565
566 # add compatibility code for non name specified case
567 if len(self.names) == 1:
568 self.revision = self.revisions[self.names[0]]
569
570 if hasattr(self.method, "fixuprevisions"):
571 self.method.fixuprevisions(self, d)
572
573 if "localpath" in self.parm: 561 if "localpath" in self.parm:
574 # if user sets localpath for file, use it instead. 562 # if user sets localpath for file, use it instead.
575 self.localpath = self.parm["localpath"] 563 self.localpath = self.parm["localpath"]
@@ -582,6 +570,15 @@ class FetchData(object):
582 self.donestamp = basepath + '.done' 570 self.donestamp = basepath + '.done'
583 self.lockfile = basepath + '.lock' 571 self.lockfile = basepath + '.lock'
584 572
573 def setup_revisons(self, d):
574 self.revisions = {}
575 for name in self.names:
576 self.revisions[name] = srcrev_internal_helper(self, d, name)
577
578 # add compatibility code for non name specified case
579 if len(self.names) == 1:
580 self.revision = self.revisions[self.names[0]]
581
585 def setup_localpath(self, d): 582 def setup_localpath(self, d):
586 if not self.localpath: 583 if not self.localpath:
587 self.localpath = self.method.localpath(self.url, self, d) 584 self.localpath = self.method.localpath(self.url, self, d)
diff --git a/bitbake/lib/bb/fetch2/bzr.py b/bitbake/lib/bb/fetch2/bzr.py
index 04a9087c11..0d10eb4a2b 100644
--- a/bitbake/lib/bb/fetch2/bzr.py
+++ b/bitbake/lib/bb/fetch2/bzr.py
@@ -45,6 +45,8 @@ class Bzr(FetchMethod):
45 relpath = self._strip_leading_slashes(ud.path) 45 relpath = self._strip_leading_slashes(ud.path)
46 ud.pkgdir = os.path.join(data.expand('${BZRDIR}', d), ud.host, relpath) 46 ud.pkgdir = os.path.join(data.expand('${BZRDIR}', d), ud.host, relpath)
47 47
48 ud.setup_revisons(d)
49
48 if not ud.revision: 50 if not ud.revision:
49 ud.revision = self.latest_revision(ud.url, ud, d) 51 ud.revision = self.latest_revision(ud.url, ud, d)
50 52
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 553e1281f2..d462acfb36 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -76,7 +76,8 @@ class Git(FetchMethod):
76 76
77 ud.localfile = ud.clonedir 77 ud.localfile = ud.clonedir
78 78
79 def fixuprevisions(self, ud, d): 79 ud.setup_revisons(d)
80
80 for name in ud.names: 81 for name in ud.names:
81 # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one 82 # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
82 if not ud.revisions[name] or len(ud.revisions[name]) != 40 or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]): 83 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/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py
index f2719d4f9e..793831ae0d 100644
--- a/bitbake/lib/bb/fetch2/hg.py
+++ b/bitbake/lib/bb/fetch2/hg.py
@@ -57,6 +57,8 @@ class Hg(FetchMethod):
57 ud.pkgdir = os.path.join(data.expand('${HGDIR}', d), ud.host, relpath) 57 ud.pkgdir = os.path.join(data.expand('${HGDIR}', d), ud.host, relpath)
58 ud.moddir = os.path.join(ud.pkgdir, ud.module) 58 ud.moddir = os.path.join(ud.pkgdir, ud.module)
59 59
60 ud.setup_revisons(d)
61
60 if 'rev' in ud.parm: 62 if 'rev' in ud.parm:
61 ud.revision = ud.parm['rev'] 63 ud.revision = ud.parm['rev']
62 elif not ud.revision: 64 elif not ud.revision:
diff --git a/bitbake/lib/bb/fetch2/svn.py b/bitbake/lib/bb/fetch2/svn.py
index fa6c654d3e..59d7ccbac1 100644
--- a/bitbake/lib/bb/fetch2/svn.py
+++ b/bitbake/lib/bb/fetch2/svn.py
@@ -56,6 +56,8 @@ class Svn(FetchMethod):
56 ud.pkgdir = os.path.join(data.expand('${SVNDIR}', d), ud.host, relpath) 56 ud.pkgdir = os.path.join(data.expand('${SVNDIR}', d), ud.host, relpath)
57 ud.moddir = os.path.join(ud.pkgdir, ud.module) 57 ud.moddir = os.path.join(ud.pkgdir, ud.module)
58 58
59 ud.setup_revisons(d)
60
59 if 'rev' in ud.parm: 61 if 'rev' in ud.parm:
60 ud.revision = ud.parm['rev'] 62 ud.revision = ud.parm['rev']
61 63