summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-04-19 23:31:09 +0100
committerSaul Wold <sgw@linux.intel.com>2011-05-06 17:44:21 -0700
commitf15a4a76770cb5eca3cd518b0ad5f7470e761017 (patch)
tree0279f41ae8643489f75adfc6387353274e4f946f /bitbake
parent0e55651fd0f12c98c5a4b894dde9162c8abcdca7 (diff)
downloadpoky-f15a4a76770cb5eca3cd518b0ad5f7470e761017.tar.gz
bitbake/fetch2/git: Fix a bug where AUTOREV and the git fetcher interact badly
Fix a bug where ud.branches were being referenced before it was set by the git fetcher when using AUTOREV. To do this some ordering needed to be changed. This fixes errors like: ERROR: Error parsing /recipes-kernel/linux/rt-tests_git.bb: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception AttributeError: 'FetchData' object has no attribute 'branches' Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py7
-rw-r--r--bitbake/lib/bb/fetch2/git.py9
2 files changed, 10 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 9fec705ad6..f53467e73b 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -555,6 +555,9 @@ class FetchData(object):
555 if not self.method: 555 if not self.method:
556 raise NoMethodError(url) 556 raise NoMethodError(url)
557 557
558 if hasattr(self.method, "urldata_init"):
559 self.method.urldata_init(self, d)
560
558 if self.method.supports_srcrev(): 561 if self.method.supports_srcrev():
559 self.revisions = {} 562 self.revisions = {}
560 for name in self.names: 563 for name in self.names:
@@ -564,8 +567,8 @@ class FetchData(object):
564 if len(self.names) == 1: 567 if len(self.names) == 1:
565 self.revision = self.revisions[self.names[0]] 568 self.revision = self.revisions[self.names[0]]
566 569
567 if hasattr(self.method, "urldata_init"): 570 if hasattr(self.method, "fixuprevisions"):
568 self.method.urldata_init(self, d) 571 self.method.fixuprevisions(self, d)
569 572
570 if "localpath" in self.parm: 573 if "localpath" in self.parm:
571 # if user sets localpath for file, use it instead. 574 # if user sets localpath for file, use it instead.
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index b5bcfcf0a5..ec27f1396e 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -72,16 +72,17 @@ class Git(FetchMethod):
72 72
73 ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git" 73 ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
74 74
75 ud.write_tarballs = (data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) or "0") != "0"
76
77 ud.localfile = ud.clonedir
78
79 def fixuprevisions(self, ud, d):
75 for name in ud.names: 80 for name in ud.names:
76 # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one 81 # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
77 if not ud.revisions[name] or len(ud.revisions[name]) != 40 or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]): 82 if not ud.revisions[name] or len(ud.revisions[name]) != 40 or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]):
78 ud.branches[name] = ud.revisions[name] 83 ud.branches[name] = ud.revisions[name]
79 ud.revisions[name] = self.latest_revision(ud.url, ud, d, name) 84 ud.revisions[name] = self.latest_revision(ud.url, ud, d, name)
80 85
81 ud.write_tarballs = (data.getVar("BB_GENERATE_MIRROR_TARBALLS", d, True) or "0") != "0"
82
83 ud.localfile = ud.clonedir
84
85 def localpath(self, url, ud, d): 86 def localpath(self, url, ud, d):
86 return ud.clonedir 87 return ud.clonedir
87 88