summaryrefslogtreecommitdiffstats
path: root/meta/classes/metadata_scm.bbclass
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2021-03-12 03:18:53 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-14 16:33:59 (GMT)
commitcfd897e213debb2e32589378b2f5d390a265eb7f (patch)
tree7f668e73f7af98fe595579baccbc947958909268 /meta/classes/metadata_scm.bbclass
parenteff09fadaf545abfe0b9d1d423505117b4a26113 (diff)
downloadpoky-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/classes/metadata_scm.bbclass')
-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 2608a7e..47cb969 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}"