diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-21 23:26:40 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-21 23:26:40 +0100 |
commit | d5504a4275d94868e28b00c272411e82f4999d95 (patch) | |
tree | d5dcf936e4150fb597f773bbc4911080ee0d3749 /meta | |
parent | f1a209b142d2319d2594b051c01d9997184bfcb4 (diff) | |
download | openembedded-core-d5504a4275d94868e28b00c272411e82f4999d95.tar.gz openembedded-core-d5504a4275d94868e28b00c272411e82f4999d95.tar.bz2 openembedded-core-d5504a4275d94868e28b00c272411e82f4999d95.tar.xz openembedded-core-d5504a4275d94868e28b00c272411e82f4999d95.zip |
metadata_scm: Ensure that if an SCM isn't present, we dont print a revision of 'fatal:' as it looks bad
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/metadata_scm.bbclass | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass index b3c06dd7f..7112ad512 100644 --- a/meta/classes/metadata_scm.bbclass +++ b/meta/classes/metadata_scm.bbclass @@ -70,8 +70,11 @@ def base_get_metadata_git_branch(path, d): return "<unknown>" def base_get_metadata_git_revision(path, d): - rev = os.popen("cd %s; git log -n 1 --pretty=oneline -- 2>&1" % path).read().split(" ")[0] - if len(rev) != 0: - return rev + f = os.popen("cd %s; git log -n 1 --pretty=oneline -- 2>&1" % path) + data = f.read() + if f.close() is None: + rev = data.split(" ")[0] + if len(rev) != 0: + return rev return "<unknown>" |