]> code.ossystems Code Review - openembedded-core.git/commitdiff
metadata_scm: Ensure that if an SCM isn't present, we dont print a revision of 'fatal...
authorRichard Purdie <rpurdie@linux.intel.com>
Thu, 21 Oct 2010 22:26:40 +0000 (23:26 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Thu, 21 Oct 2010 22:26:40 +0000 (23:26 +0100)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
meta/classes/metadata_scm.bbclass

index b3c06dd7f6fb32810c0f51e8c0dfc30d7d21efc2..7112ad512b17935a3890a723182e765702a85f3b 100644 (file)
@@ -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>"