Skip to content

Commit 2aadab3

Browse files
build/rpm.sh fails when git version is v1.5.0
We assumed a build version exists
1 parent 031cbe4 commit 2aadab3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hack/lib/build/rpm.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function os::build::rpm::get_nvra_vars() {
1919
OS_RPM_NAME="${OS_RPM_NAME:-"origin"}"
2020
OS_RPM_ARCHITECTURE="$(uname -i)"
2121

22-
# we can extract the pacakge version from the build version
22+
# we can extract the package version from the build version
2323
os::build::get_version_vars
2424
if [[ "${OS_GIT_VERSION}" =~ ^v([0-9](\.[0-9]+)*)(.*) ]]; then
2525
OS_RPM_VERSION="${BASH_REMATCH[1]}"
@@ -42,6 +42,10 @@ function os::build::rpm::get_nvra_vars() {
4242
if [[ "${metadata}" =~ ^\+([a-z0-9]{7})-([0-9]+)(-dirty)?$ ]]; then
4343
build_sha="${BASH_REMATCH[1]}"
4444
build_num="${BASH_REMATCH[2]}"
45+
# this is an exact release build
46+
elif [[ "${metadata}" =~ ^\+([a-z0-9]{7})(-dirty)?$ ]]; then
47+
build_sha="${BASH_REMATCH[1]}"
48+
build_num="0"
4549
else
4650
os::log::fatal "Malformed git version metadata: ${metadata}"
4751
fi

0 commit comments

Comments
 (0)