diff options
author | Alin Năstac <mrness@gentoo.org> | 2004-12-31 09:23:43 +0000 |
---|---|---|
committer | Alin Năstac <mrness@gentoo.org> | 2004-12-31 09:23:43 +0000 |
commit | e0efadcfd3dec644549ed24f27c2f2a014f96810 (patch) | |
tree | 8e9f911bd53559e6fc7943f732e87f22cba04d3d /eclass/linux-info.eclass | |
parent | Added ~ppc64 to KEYWORDS (Manifest recommit) (diff) | |
download | gentoo-2-e0efadcfd3dec644549ed24f27c2f2a014f96810.tar.gz gentoo-2-e0efadcfd3dec644549ed24f27c2f2a014f96810.tar.bz2 gentoo-2-e0efadcfd3dec644549ed24f27c2f2a014f96810.zip |
correct kernel_is; format kernel versions as %d%03d%03d and test them as integers
Diffstat (limited to 'eclass/linux-info.eclass')
-rw-r--r-- | eclass/linux-info.eclass | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass index 4576f08b34cf..d22bdd24d9f7 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.14 2004/12/29 11:22:41 johnm Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.15 2004/12/31 09:23:43 mrness 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 test value + local RESULT operator test value i len RESULT=0 operator="=" @@ -211,12 +211,30 @@ kernel_is() { fi if [ -n "${2}" ] then + len=$[ 3 - ${#2} ] + for((i=0; i<$len; i++)); do + value="${value}0" + done value="${value}${2}" + + len=$[ 3 - ${#KV_MINOR} ] + for((i=0; i<$len; i++)); do + test="${test}0" + done test="${test}${KV_MINOR}" fi if [ -n "${3}" ] then + len=$[ 3 - ${#3} ] + for((i=0; i<$len; i++)); do + value="${value}0" + done value="${value}${3}" + + len=$[ 3 - ${#KV_PATCH} ] + for((i=0; i<$len; i++)); do + test="${test}0" + done test="${test}${KV_PATCH}" fi |