summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2021-03-12 04:18:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-21 21:26:01 +0100
commit076d50da2e5652088d453d12eba0b5b445f29f85 (patch)
tree7e7f43a20e6a9785ab5ceb8860c0a3a3e1a7f3ee /meta/classes
parent39ba556a2e44d58415d28a513d1adb5903836c00 (diff)
downloadpoky-076d50da2e5652088d453d12eba0b5b445f29f85.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: f76fc325520386c0d25c6d6b422c85e9fb87e663) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 34e1841ec14c545c73fbe03a9f946d43d65ab326) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/metadata_scm.bbclass10
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 @@
1METADATA_BRANCH ?= "${@base_detect_branch(d)}"
2METADATA_BRANCH[vardepvalue] = "${METADATA_BRANCH}"
3METADATA_REVISION ?= "${@base_detect_revision(d)}"
4METADATA_REVISION[vardepvalue] = "${METADATA_REVISION}"
5
6def base_detect_revision(d): 1def 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
41METADATA_BRANCH := "${@base_detect_branch(d)}"
42METADATA_BRANCH[vardepvalue] = "${METADATA_BRANCH}"
43METADATA_REVISION := "${@base_detect_revision(d)}"
44METADATA_REVISION[vardepvalue] = "${METADATA_REVISION}"