/[gentoo-x86]/eclass/linux-info.eclass
Gentoo

Diff of /eclass/linux-info.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.14 Revision 1.15
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.14 2004/12/29 11:22:41 johnm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.15 2004/12/31 09:23:43 mrness Exp $
4# 4#
5# Description: This eclass is used as a central eclass for accessing kernel 5# Description: This eclass is used as a central eclass for accessing kernel
6# related information for sources already installed. 6# related information for sources already installed.
7# It is vital for linux-mod to function correctly, and is split 7# It is vital for linux-mod to function correctly, and is split
8# out so that any ebuild behaviour "templates" are abstracted out 8# out so that any ebuild behaviour "templates" are abstracted out
180 180
181kernel_is() { 181kernel_is() {
182 # if we haven't determined the version yet, we need too. 182 # if we haven't determined the version yet, we need too.
183 get_version; 183 get_version;
184 184
185 local RESULT operator test value 185 local RESULT operator test value i len
186 RESULT=0 186 RESULT=0
187 187
188 operator="=" 188 operator="="
189 if [ "${1}" == "lt" ] 189 if [ "${1}" == "lt" ]
190 then 190 then
209 value="${value}${1}" 209 value="${value}${1}"
210 test="${test}${KV_MAJOR}" 210 test="${test}${KV_MAJOR}"
211 fi 211 fi
212 if [ -n "${2}" ] 212 if [ -n "${2}" ]
213 then 213 then
214 len=$[ 3 - ${#2} ]
215 for((i=0; i<$len; i++)); do
216 value="${value}0"
217 done
214 value="${value}${2}" 218 value="${value}${2}"
219
220 len=$[ 3 - ${#KV_MINOR} ]
221 for((i=0; i<$len; i++)); do
222 test="${test}0"
223 done
215 test="${test}${KV_MINOR}" 224 test="${test}${KV_MINOR}"
216 fi 225 fi
217 if [ -n "${3}" ] 226 if [ -n "${3}" ]
218 then 227 then
228 len=$[ 3 - ${#3} ]
229 for((i=0; i<$len; i++)); do
230 value="${value}0"
231 done
219 value="${value}${3}" 232 value="${value}${3}"
233
234 len=$[ 3 - ${#KV_PATCH} ]
235 for((i=0; i<$len; i++)); do
236 test="${test}0"
237 done
220 test="${test}${KV_PATCH}" 238 test="${test}${KV_PATCH}"
221 fi 239 fi
222 240
223 [ ${test} ${operator} ${value} ] && return 0 || return 1 241 [ ${test} ${operator} ${value} ] && return 0 || return 1
224} 242}

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.20