diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-11-19 13:08:59 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-11-19 13:22:47 +0000 |
commit | 9ccfe66074cdacd1f529c241fadd52b5663584fc (patch) | |
tree | b066a678ca7bf0305a3e0d257362a374064c5fa7 /bitbake/lib/bb | |
parent | e15893adf9268b2920b24c52d5c2bb777c6f778e (diff) | |
download | poky-9ccfe66074cdacd1f529c241fadd52b5663584fc.tar.gz |
bitbake: git: Use git branch for ancestor checks
Using git merge-base for checking for ancestors is nice but required git 1.8.0
which is not in many distrbutions yet. We therefore revert to a more ugly
check using git branch --contains until such times as we can upgrade.
(Bitbake rev: 31467c0afe0346502fcd18bd376f23ea76a27d61)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 99230c170a..a901a44f03 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -283,12 +283,14 @@ class Git(FetchMethod): | |||
283 | 283 | ||
284 | def _contains_ref(self, tag, branch, d): | 284 | def _contains_ref(self, tag, branch, d): |
285 | basecmd = data.getVar("FETCHCMD_git", d, True) or "git" | 285 | basecmd = data.getVar("FETCHCMD_git", d, True) or "git" |
286 | cmd = "%s merge-base --is-ancestorlog %s %s" % (basecmd, tag, branch) | 286 | cmd = "%s branch --contains %s --list %s 2> /dev/null | wc -l" % (basecmd, tag, branch) |
287 | try: | 287 | try: |
288 | output = runfetchcmd(cmd, d, quiet=True) | 288 | output = runfetchcmd(cmd, d, quiet=True) |
289 | except bb.fetch2.FetchError: | 289 | except bb.fetch2.FetchError: |
290 | return False | 290 | return False |
291 | return True | 291 | if len(output.split()) > 1: |
292 | raise bb.fetch2.FetchError("The command '%s' gave output with more then 1 line unexpectedly, output: '%s'" % (cmd, output)) | ||
293 | return output.split()[0] != "0" | ||
292 | 294 | ||
293 | def _revision_key(self, url, ud, d, name): | 295 | def _revision_key(self, url, ud, d, name): |
294 | """ | 296 | """ |