Skip to content
This repository was archived by the owner on Jan 28, 2022. It is now read-only.

Commit 946c897

Browse files
committed
fix: Version information if built in Buildroot
The Buildroot custom package build used the wrong version information from remote-os instead of the module's git repository. Since the git metadata information is not available during Buildroot build, a QMake parameter is used instead.
1 parent 9b7b895 commit 946c897

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

remote.pro

+20-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,24 @@ CONFIG += qtquickcompiler
2828

2929
DEFINES += QT_DEPRECATED_WARNINGS
3030

31-
# SOFTWARE VERSION
32-
GIT_HASH = "$$system(git log -1 --format="%H")"
33-
GIT_BRANCH = "$$system(git rev-parse --abbrev-ref HEAD)"
34-
GIT_VERSION = "$$system(git describe --match "v[0-9]*" --tags HEAD --always)"
31+
# === Version and build information ===========================================
32+
# If built in Buildroot use custom package version, otherwise Git
33+
isEmpty(YIO_BUILD_VERSION) {
34+
GIT_VERSION = "$$system(git describe --match "v[0-9]*" --tags HEAD --always)"
35+
GIT_HASH = "$$system(git log -1 --format="%H")"
36+
GIT_BRANCH = "$$system(git rev-parse --abbrev-ref HEAD)"
37+
} else {
38+
GIT_VERSION = $$YIO_BUILD_VERSION
39+
contains(GIT_VERSION, "^v?(0|[1-9]\d*)\..*") {
40+
# (simplified) version string = regular release
41+
GIT_HASH = ""
42+
GIT_BRANCH = "master"
43+
} else {
44+
# git hash as version = custom build
45+
GIT_HASH = $$YIO_BUILD_VERSION
46+
GIT_BRANCH = ""
47+
}
48+
}
3549
REMOTE_VERSION = $$replace(GIT_VERSION, v, "")
3650
DEFINES += APP_VERSION=\\\"$$REMOTE_VERSION\\\"
3751

@@ -42,6 +56,8 @@ win32 {
4256
} else {
4357
BUILDDATE=$$system(date +"%Y-%m-%dT%H:%M:%S")
4458
}
59+
# =============================================================================
60+
4561
CONFIG(debug, debug|release) {
4662
DEBUG_BUILD = true
4763
} else {

0 commit comments

Comments
 (0)