/[gentoo-x86]/eclass/kernel-2.eclass
Gentoo

Diff of /eclass/kernel-2.eclass

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

Revision 1.63 Revision 1.64
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/kernel-2.eclass,v 1.63 2004/12/27 13:31:48 johnm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.64 2004/12/28 20:14:44 johnm Exp $
4 4
5# Description: kernel.eclass rewrite for a clean base regarding the 2.6 5# Description: kernel.eclass rewrite for a clean base regarding the 2.6
6# series of kernel with back-compatibility for 2.4 6# series of kernel with back-compatibility for 2.4
7# 7#
8# Maintainer: John Mylchreest <johnm@gentoo.org> 8# Maintainer: John Mylchreest <johnm@gentoo.org>
58[ -z "$LINUX_HOSTCFLAGS" ] && LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include" 58[ -z "$LINUX_HOSTCFLAGS" ] && LINUX_HOSTCFLAGS="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include"
59 59
60#Eclass functions only from here onwards ... 60#Eclass functions only from here onwards ...
61#============================================================== 61#==============================================================
62kernel_is() { 62kernel_is() {
63 local RESULT 63 # if we haven't determined the version yet, we need too.
64 get_version;
65
66 local RESULT operator value test
64 RESULT=1 67 RESULT=0
68
69 operator="-eq"
70 if [ "${1}" == "lt" ]
71 then
72 operator="-lt"
73 shift
74 elif [ "${1}" == "gt" ]
75 then
76 operator="-gt"
77 shift
78 elif [ "${1}" == "le" ]
79 then
80 operator="-le"
81 shift
82 elif [ "${1}" == "ge" ]
83 then
84 operator="-ge"
85 shift
86 fi
65 87
66 if [ -n "${1}" ] 88 if [ -n "${1}" ]
67 then 89 then
68 [ "${1}" = "${KV_MAJOR}" ] && RESULT=0 90 [ ${KV_MAJOR} ${operator} ${1} ] || RESULT=1
69 fi 91 fi
70
71 if [ -n "${2}" ] 92 if [ -n "${2}" ]
72 then 93 then
73 RESULT=1 94 [ ${KV_MINOR} ${operator} ${2} -a ${RESULT} -eq 0 ] || RESULT=1
74 [ "${2}" = "${KV_MINOR}" ] && RESULT=0
75 fi 95 fi
76
77 if [ -n "${3}" ] 96 if [ -n "${3}" ]
78 then 97 then
79 RESULT=1 98 [ ${KV_PATCH} ${operator} ${3} -a ${RESULT} -eq 0 ] || RESULT=1
80 [ "${3}" = "${KV_PATCH}" ] && RESULT=0
81 fi 99 fi
82 return ${RESULT} 100 return ${RESULT}
83} 101}
102
84 103
85kernel_is_2_4() { 104kernel_is_2_4() {
86 kernel_is 2 4 105 kernel_is 2 4
87 return $? 106 return $?
88} 107}

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.64

  ViewVC Help
Powered by ViewVC 1.1.20