1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 05:09:24 +00:00

metadata_scm.bbclass: simplify base_detect_revision()

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().

(From OE-Core rev: 8a6e70960e021e10a1d02e20e0519fdbdeac8616)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Robert Yang
2018-11-07 18:02:37 +08:00
committed by Richard Purdie
parent 68dfc310f5
commit a0618f5726
+2 -18
View File
@@ -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')