summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mylchreest <johnm@gentoo.org>2004-12-29 11:22:41 +0000
committerJohn Mylchreest <johnm@gentoo.org>2004-12-29 11:22:41 +0000
commit87d1b495228da41d0c59008a8ea41bec2fd21dca (patch)
treec8722ddda77e4a1c4ad4ab5b4e8470e9017c35c3 /eclass/linux-info.eclass
parentNew upstream release finally; now officially recognizes Gentoo 1.6 (>=sys-app... (diff)
downloadhistorical-87d1b495228da41d0c59008a8ea41bec2fd21dca.tar.gz
historical-87d1b495228da41d0c59008a8ea41bec2fd21dca.tar.bz2
historical-87d1b495228da41d0c59008a8ea41bec2fd21dca.zip
Fixing up test logic in kernel_is
Diffstat (limited to 'eclass/linux-info.eclass')
-rw-r--r--eclass/linux-info.eclass16
1 files changed, 10 insertions, 6 deletions
diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index e3ef3dab9360..4576f08b34cf 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.13 2004/12/28 21:00:10 johnm Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.14 2004/12/29 11:22:41 johnm Exp $
#
# Description: This eclass is used as a central eclass for accessing kernel
# related information for sources already installed.
@@ -182,7 +182,7 @@ kernel_is() {
# if we haven't determined the version yet, we need too.
get_version;
- local RESULT operator value test
+ local RESULT operator test value
RESULT=0
operator="="
@@ -206,17 +206,21 @@ kernel_is() {
if [ -n "${1}" ]
then
- [ ${KV_MAJOR} ${operator} ${1} ] || RESULT=1
+ value="${value}${1}"
+ test="${test}${KV_MAJOR}"
fi
if [ -n "${2}" ]
then
- [ ${KV_MINOR} ${operator} ${2} -a ${RESULT} -eq 0 ] || RESULT=1
+ value="${value}${2}"
+ test="${test}${KV_MINOR}"
fi
if [ -n "${3}" ]
then
- [ ${KV_PATCH} ${operator} ${3} -a ${RESULT} -eq 0 ] || RESULT=1
+ value="${value}${3}"
+ test="${test}${KV_PATCH}"
fi
- return ${RESULT}
+
+ [ ${test} ${operator} ${value} ] && return 0 || return 1
}
get_version() {