fetch2/git: be more carefull in _contains_ref when checking git log output

* in some cases there could be output like this
  ERROR: ld.so: object 'libpseudo.so' from LD_PRELOAD cannot be preloaded: ignored.
  before wc -l output and returned 'output.split()[0] != 0' is always True

(Bitbake rev: 3a54dcc09a12406ec6cf22b4b1a2cc4fc203822c)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Martin Jansa 2011-09-16 09:38:22 +02:00 committed by Richard Purdie
parent 35fdd5a195
commit 28c3aa8b85
1 changed files with 4 additions and 1 deletions

View File

@ -239,7 +239,10 @@ class Git(FetchMethod):
def _contains_ref(self, tag, d):
basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
output = runfetchcmd("%s log --pretty=oneline -n 1 %s -- 2> /dev/null | wc -l" % (basecmd, tag), d, quiet=True)
cmd = "%s log --pretty=oneline -n 1 %s -- 2> /dev/null | wc -l" % (basecmd, tag)
output = runfetchcmd(cmd, d, quiet=True)
if len(output.split()) > 1:
raise bb.fetch2.FetchError("The command '%s' gave output with more then 1 line unexpectedly, output: '%s'" % (cmd, output))
return output.split()[0] != "0"
def _revision_key(self, url, ud, d, name):