permit OS_GIT_VERSION to have a git hash longer than 7 characters - this
occurs when 7 characters are not enough to uniquely describe a given commit
@@ -45,7 +45,7 @@ function os::build::rpm::get_nvra_vars() {
if [[ "${metadata:0:1}" == "+" ]]; then
# we only have build metadata, but need to massage it so
# we can generate a valid RPM release from it
- if [[ "${metadata}" =~ ^\+([a-z0-9]{7})(-([0-9]+))?(-dirty)?$ ]]; then
+ if [[ "${metadata}" =~ ^\+([a-z0-9]{7,40})(-([0-9]+))?(-dirty)?$ ]]; then
build_sha="${BASH_REMATCH[1]}"
build_num="${BASH_REMATCH[3]:-0}"
else
@@ -54,7 +54,7 @@ function os::build::rpm::get_nvra_vars() {
OS_RPM_RELEASE="1.${build_num}.${build_sha}"
elif [[ "${metadata:0:1}" == "-" ]]; then
# we have both build metadata and pre-release info
- if [[ "${metadata}" =~ ^-([^\+]+)\+([a-z0-9]{7})(-([0-9]+))?(-dirty)?$ ]]; then
+ if [[ "${metadata}" =~ ^-([^\+]+)\+([a-z0-9]{7,40})(-([0-9]+))?(-dirty)?$ ]]; then
pre_release="${BASH_REMATCH[1]}"
build_sha="${BASH_REMATCH[2]}"
build_num="${BASH_REMATCH[4]:-0}"
