summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2018-11-07 17:33:26 +0800
committerRobert Yang <liezhi.yang@windriver.com>2018-11-07 18:01:34 +0800
commit3eeb029c4b3b85468a7568f7d51fd637b9d8960c (patch)
tree3e23772f0a731f8f86893df5c0d79bfd8440d8b0
parent14b5854d50c38e94fc0d1ce6af36698fc69f52b4 (diff)
downloadopenembedded-core-contrib-3eeb029c4b3b85468a7568f7d51fd637b9d8960c.tar.gz
openembedded-core-contrib-3eeb029c4b3b85468a7568f7d51fd637b9d8960c.tar.bz2
openembedded-core-contrib-3eeb029c4b3b85468a7568f7d51fd637b9d8960c.zip
metadata_scm.bbclass: simplify base_detect_revision()rbt/scm
The previous code looks strange because of historical reason, simply return base_get_metadata_git_revision/branch() is enough, the later functions has handled everything like '<unknown>' and strip(). Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-rw-r--r--meta/classes/metadata_scm.bbclass20
1 files changed, 2 insertions, 18 deletions
diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass
index fa791f04c4..658e2f883b 100644
--- a/meta/classes/metadata_scm.bbclass
+++ b/meta/classes/metadata_scm.bbclass
@@ -3,27 +3,11 @@ METADATA_REVISION ?= "${@base_detect_revision(d)}"
def base_detect_revision(d):
path = base_get_scmbasepath(d)
-
- scms = [base_get_metadata_git_revision]
-
- for scm in scms:
- rev = scm(path, d)
- if rev != "<unknown>":
- return rev
-
- return "<unknown>"
+ return base_get_metadata_git_revision(path, d)
def base_detect_branch(d):
path = base_get_scmbasepath(d)
-
- scms = [base_get_metadata_git_branch]
-
- for scm in scms:
- rev = scm(path, d)
- if rev != "<unknown>":
- return rev.strip()
-
- return "<unknown>"
+ return base_get_metadata_git_branch(path, d)
def base_get_scmbasepath(d):
return os.path.join(d.getVar('COREBASE'), 'meta')