aboutsummaryrefslogtreecommitdiff
path: root/sh/functions.sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-05-05 20:27:50 +0000
committerRoy Marples <roy@marples.name>2007-05-05 20:27:50 +0000
commit2ad5c3eb33b926d49014aa8cc2ac596506f570e6 (patch)
tree3d74bc70c7114631eb166669c13baed4068939ba /sh/functions.sh
parent35487d931314011e8e3b0f43c2b1605efcda5460 (diff)
Fix KV_to_int working with funky kernel versions, #177197.
Diffstat (limited to 'sh/functions.sh')
-rw-r--r--sh/functions.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/sh/functions.sh b/sh/functions.sh
index 69c73cdc..cfd8b005 100644
--- a/sh/functions.sh
+++ b/sh/functions.sh
@@ -104,11 +104,12 @@ uniqify() {
KV_to_int() {
[ -z $1 ] && return 1
- local KV_MAJOR=${1%%.*}
- local x=${1#*.}
+ local x=${1%%-*}
+ local KV_MAJOR=${x%%.*}
+ x=${x#*.}
local KV_MINOR=${x%%.*}
x=${1#*.*.}
- local KV_MICRO=${x%%-*}
+ local KV_MICRO=${x%%.*}
local KV_int=$((${KV_MAJOR} * 65536 + ${KV_MINOR} * 256 + ${KV_MICRO} ))
# We make version 2.2.0 the minimum version we will handle as