From: Michael Jeanson Date: Thu, 9 Aug 2018 15:56:55 +0000 (-0400) Subject: Fix: Allow alphanumeric characters in SLE version X-Git-Tag: v2.9.10~2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d2aef5e31f6d983b18e165d4241fbba8e00c5811;p=lttng-modules.git Fix: Allow alphanumeric characters in SLE version Allow alphanumeric characters in the long version string before extracting specific version numbers. This prevents failure in detecting a SuSE kernel when the version string was customized by the end user. Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/abi-sle-version.sh b/abi-sle-version.sh index 0bd65b15..59e7d67d 100755 --- a/abi-sle-version.sh +++ b/abi-sle-version.sh @@ -22,7 +22,7 @@ if [ ! -f "${KPATH}/include/generated/utsrelease.h" ]; then exit 0 fi -SLE_RELEASE="$(sed -rn 's/^#define UTS_RELEASE "(.*)-([0-9\.]+)-(.*)"/\2/p' "${KPATH}/include/generated/utsrelease.h")" +SLE_RELEASE="$(sed -rn 's/^#define UTS_RELEASE "(.*)-([0-9a-zA-Z\.]+)-(.*)"/\2/p' "${KPATH}/include/generated/utsrelease.h")" SLE_RELEASE_MAJOR="$(echo "${SLE_RELEASE}" | sed -rn 's/^([0-9]+)(.*)$/\1/p')" SLE_RELEASE_MINOR="$(echo "${SLE_RELEASE}" | sed -rn 's/^([0-9]+)\.([0-9]+)(.*)$/\2/p')"