]> code.ossystems Code Review - openembedded-core.git/commitdiff
metadata_scm.bbclass: Do not assume ${COREBASE} is a Git repo
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>
Fri, 29 Apr 2016 17:03:45 +0000 (19:03 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 29 Jun 2016 18:34:42 +0000 (19:34 +0100)
The functions base_detect_revision() and base_detect_branch() try to
extract SCM meta information from the path returned by
base_get_scmbasepath(), which currently returns ${COREBASE}. However,
making the assumption that ${COREBASE} contains SCM meta information
can be false. It is true for Poky, but not necessarily other
environments. A better option is to look for the SCM meta information
based on the meta layer.

Since this works as expected for Git but not SVN, the call to
base_get_metadata_svn_revision() from base_detect_revision() was also
removed. This is not expected to affect anyone (partly based on the
comment in base_get_metadata_svn_revision()).

(From OE-Core rev: 53fd0a4a37023642a770a9fbf3cd5511d3c82af7)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/classes/metadata_scm.bbclass

index 0f7f4235a34b31fc86449dbb9097b0b26bfa3342..2e6fac209a09572650e4ceaff7ee5b65c30daf7c 100644 (file)
@@ -4,8 +4,7 @@ METADATA_REVISION ?= "${@base_detect_revision(d)}"
 def base_detect_revision(d):
     path = base_get_scmbasepath(d)
 
-    scms = [base_get_metadata_git_revision, \
-            base_get_metadata_svn_revision]
+    scms = [base_get_metadata_git_revision]
 
     for scm in scms:
         rev = scm(path, d)
@@ -27,7 +26,7 @@ def base_detect_branch(d):
     return "<unknown>"
 
 def base_get_scmbasepath(d):
-    return d.getVar( 'COREBASE', True)
+    return os.path.join(d.getVar('COREBASE', True), 'meta')
 
 def base_get_metadata_monotone_branch(path, d):
     monotone_branch = "<unknown>"