base.bbclass: set PATH when calling git for metadata scm bits.
authorChris Larson <clarson@mvista.com>
Wed, 10 Jun 2009 19:34:32 +0000 (12:34 -0700)
committerChris Larson <clarson@mvista.com>
Wed, 17 Jun 2009 18:51:18 +0000 (11:51 -0700)
Signed-off-by: Chris Larson <clarson@mvista.com>
classes/base.bbclass

index 6cafe9d..116605f 100644 (file)
@@ -885,7 +885,7 @@ def base_get_metadata_svn_revision(path, d):
 
 def base_get_metadata_git_branch(path, d):
        import os
-       branch = os.popen('cd %s; git symbolic-ref HEAD 2>/dev/null' % path).read().rstrip()
+       branch = os.popen('cd %s; PATH=%s git symbolic-ref HEAD 2>/dev/null' % (path, d.getVar("BBPATH", 1))).read().rstrip()
 
        if len(branch) != 0:
                return branch.replace("refs/heads/", "")
@@ -893,7 +893,7 @@ def base_get_metadata_git_branch(path, d):
 
 def base_get_metadata_git_revision(path, d):
        import os
-       rev = os.popen("cd %s; git show-ref HEAD 2>/dev/null" % path).read().split(" ")[0].rstrip()
+       rev = os.popen("cd %s; PATH=%s git show-ref HEAD 2>/dev/null" % (path, d.getVar("BBPATH", 1))).read().split(" ")[0].rstrip()
        if len(rev) != 0:
                return rev
        return "<unknown>"