Skip to content

Commit d439cb0

Browse files
authored
Merge pull request #457 from linuxianer99/scarthgap
refactor: update IMAGE_VERSION_SUFFIX retrieval to use meta-openvario…
2 parents 578aaa8 + f55a3af commit d439cb0

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

classes/compose_image-version-suffix.bbclass

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@ python () {
33
import os.path
44

55
try:
6-
parentRepo = os.path.dirname(d.getVar("COREBASE", True))
7-
version = subprocess.check_output(["git", "describe", "--tags", "--dirty"], cwd = parentRepo, stderr = subprocess.DEVNULL).strip().decode('UTF-8')
6+
# Get the path to the meta-openvario layer
7+
layerdir = d.getVar('LAYERDIR_meta-openvario')
8+
9+
# Get the Git revision from the meta-openvario layer
10+
version = subprocess.check_output(
11+
["git", "describe", "--tags", "--dirty"],
12+
cwd=layerdir,
13+
stderr=subprocess.DEVNULL
14+
).strip().decode("utf-8")
15+
16+
# Set the IMAGE_VERSION_SUFFIX variable to the Git revision
817
d.setVar("IMAGE_VERSION_SUFFIX", version)
9-
except:
10-
bb.warn("Could not get Git revision, image will have default version.")
18+
19+
except Exception as e:
20+
bb.warn("Could not get Git revision from meta-openvario: %s" % e)
1121
}

0 commit comments

Comments
 (0)