diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2021-03-12 04:18:53 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-21 21:26:01 +0100 |
commit | 076d50da2e5652088d453d12eba0b5b445f29f85 (patch) | |
tree | 7e7f43a20e6a9785ab5ceb8860c0a3a3e1a7f3ee /meta/classes | |
parent | 39ba556a2e44d58415d28a513d1adb5903836c00 (diff) | |
download | poky-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.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}" | ||