From ed25dd6107ddd77badf830e152174dde441df972 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Oct 2017 09:55:19 +0200 Subject: [PATCH] Pmodules/modbuild: fix bug in splitting version number --- Pmodules/modbuild | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/Pmodules/modbuild b/Pmodules/modbuild index 5578d8f..fe4e308 100755 --- a/Pmodules/modbuild +++ b/Pmodules/modbuild @@ -347,14 +347,29 @@ else fi fi -declare V_MAJOR=${V%%.*} -declare tmp=${V#*.} -declare V_MINOR=${tmp%%.*} -tmp=${tmp#*.} -declare V_PATCHLVL=${tmp%%-*} -declare V_RELEASE=${tmp#*-} -declare V_PKG="${V_MAJOR}.${V_MINOR}.${V_PATCHLVL}" +declare V_MAJOR='' +declare V_MINOR='' +declare V_PATCHLVL='' +declare V_PKG="${V%%-*}" +declare V_RELEASE="${V#*-}" +declare tmp="${V_PKG}" + +case "${tmp}" in + *.*.* ) + V_MAJOR="${tmp%%.*}" + tmp="${tmp#*.}" + V_MINOR="${tmp%%.*}" + V_PATCHLVL="${tmp#*.}" + ;; + *.* ) + V_MAJOR="${tmp%.*}" + V_MINOR="${tmp#*.}" + ;; + * ) + V_MAJOR="${tmp}" + ;; +esac P=$(basename $(dirname "${BUILD_BLOCK}")) [[ -z ${V} ]] && std::die 1 "Module version must be specified on command line!"