Fix: Allow alphanumeric characters in SLE version
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 9 Aug 2018 15:56:55 +0000 (11:56 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 9 Aug 2018 19:10:11 +0000 (15:10 -0400)
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 <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
abi-sle-version.sh

index 0bd65b152853ceb2151194f082f8e74c44a25a70..59e7d67d1c590bcf67bbd92e3d9b939230886dd1 100755 (executable)
@@ -22,7 +22,7 @@ if [ ! -f "${KPATH}/include/generated/utsrelease.h" ]; then
        exit 0
 fi
 
        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')"
 
 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')"
This page took 0.027962 seconds and 4 git commands to generate.