diff options
-rw-r--r-- | eclass/kernel-2.eclass | 9 | ||||
-rw-r--r-- | eclass/linux-info.eclass | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 4597da4c96bc..8c1740998272 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -560,7 +560,7 @@ kernel_is() { [[ ${n} -eq 1 ]] && detect_version # Now we can continue - local operator + local operator test value case ${1#-} in lt) operator="-lt"; shift;; @@ -572,10 +572,9 @@ kernel_is() { esac [[ $# -gt 3 ]] && die "Error in kernel-2_kernel_is(): too many parameters" - ver_test \ - "${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" \ - "${operator}" \ - "${1:-${KV_MAJOR}}.${2:-${KV_MINOR}}.${3:-${KV_PATCH}}" + : $(( test = (KV_MAJOR << 16) + (KV_MINOR << 8) + KV_PATCH )) + : $(( value = (${1:-${KV_MAJOR}} << 16) + (${2:-${KV_MINOR}} << 8) + ${3:-${KV_PATCH}} )) + [ ${test} ${operator} ${value} ] } # Capture the sources type and set DEPENDs diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass index 5456d6be02eb..124fb70e78ad 100644 --- a/eclass/linux-info.eclass +++ b/eclass/linux-info.eclass @@ -395,7 +395,7 @@ kernel_is() { linux-info_get_any_version # Now we can continue - local operator + local operator test value case ${1#-} in lt) operator="-lt"; shift;; @@ -407,10 +407,9 @@ kernel_is() { esac [[ $# -gt 3 ]] && die "Error in kernel-2_kernel_is(): too many parameters" - ver_test \ - "${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" \ - "${operator}" \ - "${1:-${KV_MAJOR}}.${2:-${KV_MINOR}}.${3:-${KV_PATCH}}" + : $(( test = (KV_MAJOR << 16) + (KV_MINOR << 8) + KV_PATCH )) + : $(( value = (${1:-${KV_MAJOR}} << 16) + (${2:-${KV_MINOR}} << 8) + ${3:-${KV_PATCH}} )) + [ ${test} ${operator} ${value} ] } get_localversion() { |