diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-21 23:26:40 +0100 |
---|---|---|
committer | Saul Wold <Saul.Wold@intel.com> | 2010-10-22 11:12:09 -0700 |
commit | 411910bb98e3cebf29e23bf7a173fd5711c8c459 (patch) | |
tree | 2bf72afb2b2b1e3adc86fdc8a35c92b77b319464 | |
parent | 23bae7e2992d3c4da8c2074d5b0830641deb6bfb (diff) | |
download | poky-411910bb98e3cebf29e23bf7a173fd5711c8c459.tar.gz |
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>
-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 b3c06dd7f6..7112ad512b 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): | |||
70 | return "<unknown>" | 70 | return "<unknown>" |
71 | 71 | ||
72 | def base_get_metadata_git_revision(path, d): | 72 | def base_get_metadata_git_revision(path, d): |
73 | rev = os.popen("cd %s; git log -n 1 --pretty=oneline -- 2>&1" % path).read().split(" ")[0] | 73 | f = os.popen("cd %s; git log -n 1 --pretty=oneline -- 2>&1" % path) |
74 | if len(rev) != 0: | 74 | data = f.read() |
75 | return rev | 75 | if f.close() is None: |
76 | rev = data.split(" ")[0] | ||
77 | if len(rev) != 0: | ||
78 | return rev | ||
76 | return "<unknown>" | 79 | return "<unknown>" |
77 | 80 | ||