/[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.11 Revision 1.12
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.11 2004/12/17 15:12:07 johnm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.12 2004/12/28 20:05:45 johnm 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 185 local RESULT operator value test
186 RESULT=1 186 RESULT=0
187 187
188 operator="-eq"
189 if [ "${1}" == "lt" ]
190 then
191 operator="-lt"
192 shift
193 elif [ "${1}" == "gt" ]
194 then
195 operator="-gt"
196 shift
197 elif [ "${1}" == "le" ]
198 then
199 operator="-le"
200 shift
201 elif [ "${1}" == "ge" ]
202 then
203 operator="-ge"
204 shift
205 fi
206
188 if [ -n "${1}" ] 207 if [ -n "${1}" ]
189 then 208 then
190 [ "${1}" = "${KV_MAJOR}" ] && RESULT=0 209 [ ${KV_MAJOR} ${operator} ${1} ] || RESULT=1
191 fi 210 fi
192
193 if [ -n "${2}" ] 211 if [ -n "${2}" ]
194 then 212 then
195 RESULT=1 213 [ ${KV_MINOR} ${operator} ${2} -a ${RESULT} -eq 0 ] || RESULT=1
196 [ "${2}" = "${KV_MINOR}" ] && RESULT=0
197 fi 214 fi
198
199 if [ -n "${3}" ] 215 if [ -n "${3}" ]
200 then 216 then
201 RESULT=1 217 [ ${KV_PATCH} ${operator} ${3} -a ${RESULT} -eq 0 ] || RESULT=1
202 [ "${3}" = "${KV_PATCH}" ] && RESULT=0
203 fi 218 fi
204 return ${RESULT} 219 return ${RESULT}
205} 220}
206 221
207get_version() { 222get_version() {
299 qeinfo " ${KV_FULL}" 314 qeinfo " ${KV_FULL}"
300 315
301 if [ ! -s "${KV_OUT_DIR}/.config" ] 316 if [ ! -s "${KV_OUT_DIR}/.config" ]
302 then 317 then
303 qeerror "Could not find a usable .config in the kernel source directory." 318 qeerror "Could not find a usable .config in the kernel source directory."
304 qeerror "Please ensure that ${KERNEL_DIR} points to a configured set of Linux sources" 319 qeerror "Please ensure that ${KERNEL_DIR} points to a configured set of Linux sources."
320 qeerror "If you are using KBUILD_OUTPUT, please set the environment var so that"
321 qeerror "it points to the necessary object directory so that it might find .config."
305 die ".config not found in ${KV_OUT_DIR}" 322 die ".config not found in ${KV_OUT_DIR}"
306 fi 323 fi
307} 324}
308 325
309 326

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.20