summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch/git.py
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-06-10 11:21:43 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2009-06-10 11:21:43 +0100
commit522cffdb9ecf56efa663052788fc3f0fa8b63ef7 (patch)
tree5971eb6fa70f6ae744e838b75097d01582ffadd4 /bitbake/lib/bb/fetch/git.py
parent5f37dfd98b624111d573bcdadfad0ee82c999cbe (diff)
downloadpoky-522cffdb9ecf56efa663052788fc3f0fa8b63ef7.tar.gz
bitbake: Add PN to SRCREV keyhash in the persistent database to avoid conflicts between pacckages (from upstream bitbake)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/fetch/git.py')
-rw-r--r--bitbake/lib/bb/fetch/git.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch/git.py b/bitbake/lib/bb/fetch/git.py
index 4cae1c1879..5cdf656a3a 100644
--- a/bitbake/lib/bb/fetch/git.py
+++ b/bitbake/lib/bb/fetch/git.py
@@ -146,3 +146,44 @@ class Git(Fetch):
146 def _build_revision(self, url, ud, d): 146 def _build_revision(self, url, ud, d):
147 return ud.tag 147 return ud.tag
148 148
149 def _want_sortable_revision(self, url, ud, d):
150 return bb.data.getVar("BB_GIT_CLONE_FOR_SRCREV", d, True) or False
151
152 def _sortable_revision(self, url, ud, d):
153 """
154 This is only called when _want_sortable_revision called true
155
156 We will have to get the updated revision.
157 """
158 gitsrcname = '%s%s' % (ud.host, ud.path.replace('/', '.'))
159 repodir = os.path.join(data.expand('${GITDIR}', d), gitsrcname)
160
161 key = "GIT_CACHED_REVISION-%s-%s" % (gitsrcname, ud.tag)
162 if bb.data.getVar(key, d):
163 return bb.data.getVar(key, d)
164
165
166 # Runtime warning on wrongly configured sources
167 if ud.tag == "1":
168 bb.msg.error(1, bb.msg.domain.Fetcher, "SRCREV is '1'. This indicates a configuration error of %s" % url)
169 return "0+1"
170
171 cwd = os.getcwd()
172
173 # Check if we have the rev already
174 if not os.path.exists(repodir):
175 print "no repo"
176 self.go(None, ud, d)
177
178 os.chdir(repodir)
179 if not self._contains_ref(ud.tag, d):
180 self.go(None, ud, d)
181
182 output = runfetchcmd("git rev-list %s -- 2> /dev/null | wc -l" % ud.tag, d, quiet=True)
183 os.chdir(cwd)
184
185 sortable_revision = "%s+%s" % (output.split()[0], ud.tag)
186 bb.data.setVar(key, sortable_revision, d)
187 return sortable_revision
188
189