diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2021-03-12 04:18:53 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-14 16:33:59 +0000 |
commit | cfd897e213debb2e32589378b2f5d390a265eb7f (patch) | |
tree | 7f668e73f7af98fe595579baccbc947958909268 /meta | |
parent | eff09fadaf545abfe0b9d1d423505117b4a26113 (diff) | |
download | poky-cfd897e213debb2e32589378b2f5d390a265eb7f.tar.gz |
metadata_scm.bbclass: Use immediate expansion for the METADATA_* variables
Define METADATA_BRANCH and METADATA_REVISION using immediate expansion.
This avoids running `git rev-parse HEAD` multiple times during recipe
parsing.
(From OE-Core rev: 34e1841ec14c545c73fbe03a9f946d43d65ab326)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/metadata_scm.bbclass | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass index 2608a7ef7b..47cb969b8d 100644 --- a/meta/classes/metadata_scm.bbclass +++ b/meta/classes/metadata_scm.bbclass | |||
@@ -1,8 +1,3 @@ | |||
1 | METADATA_BRANCH ?= "${@base_detect_branch(d)}" | ||
2 | METADATA_BRANCH[vardepvalue] = "${METADATA_BRANCH}" | ||
3 | METADATA_REVISION ?= "${@base_detect_revision(d)}" | ||
4 | METADATA_REVISION[vardepvalue] = "${METADATA_REVISION}" | ||
5 | |||
6 | def base_detect_revision(d): | 1 | def base_detect_revision(d): |
7 | path = base_get_scmbasepath(d) | 2 | path = base_get_scmbasepath(d) |
8 | return base_get_metadata_git_revision(path, d) | 3 | return base_get_metadata_git_revision(path, d) |
@@ -42,3 +37,8 @@ def base_get_metadata_git_revision(path, d): | |||
42 | except bb.process.ExecutionError: | 37 | except bb.process.ExecutionError: |
43 | rev = '<unknown>' | 38 | rev = '<unknown>' |
44 | return rev.strip() | 39 | return rev.strip() |
40 | |||
41 | METADATA_BRANCH := "${@base_detect_branch(d)}" | ||
42 | METADATA_BRANCH[vardepvalue] = "${METADATA_BRANCH}" | ||
43 | METADATA_REVISION := "${@base_detect_revision(d)}" | ||
44 | METADATA_REVISION[vardepvalue] = "${METADATA_REVISION}" | ||