diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2018-11-07 18:02:37 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-11-14 11:14:39 +0000 |
commit | a0618f5726376c34bbe356834e250a374bdcb718 (patch) | |
tree | 75f8bdb9c2cf09fcf8a948918c6f24c9c06ed75e /meta/classes/metadata_scm.bbclass | |
parent | 68dfc310f52566be0dbcf9711ecc65d65a919de5 (diff) | |
download | poky-a0618f5726376c34bbe356834e250a374bdcb718.tar.gz |
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>
Diffstat (limited to 'meta/classes/metadata_scm.bbclass')
-rw-r--r-- | meta/classes/metadata_scm.bbclass | 20 |
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)}" | |||
3 | 3 | ||
4 | def base_detect_revision(d): | 4 | def base_detect_revision(d): |
5 | path = base_get_scmbasepath(d) | 5 | path = base_get_scmbasepath(d) |
6 | 6 | return base_get_metadata_git_revision(path, d) | |
7 | scms = [base_get_metadata_git_revision] | ||
8 | |||
9 | for scm in scms: | ||
10 | rev = scm(path, d) | ||
11 | if rev != "<unknown>": | ||
12 | return rev | ||
13 | |||
14 | return "<unknown>" | ||
15 | 7 | ||
16 | def base_detect_branch(d): | 8 | def base_detect_branch(d): |
17 | path = base_get_scmbasepath(d) | 9 | path = base_get_scmbasepath(d) |
18 | 10 | return base_get_metadata_git_branch(path, d) | |
19 | scms = [base_get_metadata_git_branch] | ||
20 | |||
21 | for scm in scms: | ||
22 | rev = scm(path, d) | ||
23 | if rev != "<unknown>": | ||
24 | return rev.strip() | ||
25 | |||
26 | return "<unknown>" | ||
27 | 11 | ||
28 | def base_get_scmbasepath(d): | 12 | def base_get_scmbasepath(d): |
29 | return os.path.join(d.getVar('COREBASE'), 'meta') | 13 | return os.path.join(d.getVar('COREBASE'), 'meta') |