diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2010-05-20 23:11:48 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2010-05-20 23:11:48 +0000 |
commit | bdc72dd7bcfc1deec9485734942cf4692d156966 (patch) | |
tree | b1d6f5560b620405b6e8202955cf5f8184975d83 /eclass/kernel-2.eclass | |
parent | Version bump. Add gst-plugins-soup dependency with nsplugin, bug #291705. Imp... (diff) | |
download | gentoo-2-bdc72dd7bcfc1deec9485734942cf4692d156966.tar.gz gentoo-2-bdc72dd7bcfc1deec9485734942cf4692d156966.tar.bz2 gentoo-2-bdc72dd7bcfc1deec9485734942cf4692d156966.zip |
Bug #317297: Some kernel sources packages in overlays have version numbers like -9999 that does not allow us to work out what the actual version number is for functions like kernel_is. They SHOULD have a CKV variable in this case, but without it, they previously went into an infinite loop during the version detection in the eclass.
Diffstat (limited to 'eclass/kernel-2.eclass')
-rw-r--r-- | eclass/kernel-2.eclass | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 4767cbf750c3..89244b7c0274 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.233 2010/05/02 11:05:28 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.234 2010/05/20 23:11:48 robbat2 Exp $ # Description: kernel.eclass rewrite for a clean base regarding the 2.6 # series of kernel with back-compatibility for 2.4 @@ -158,6 +158,15 @@ detect_version() { KV_PATCH=$(get_version_component_range 3- ${OKV}) fi KV_PATCH=${KV_PATCH/[-_]*} + + local v n=0 missing + for v in CKV OKV KV_{MAJOR,MINOR,PATCH} ; do + [[ -z ${!v} ]] && n=1 && missing="${missing}${v} "; + done + [[ $n -eq 1 ]] && \ + eerror "Missing variables: ${missing}" && \ + die "Failed to extract kernel version (try explicit CKV in ebuild)!" + unset v n missing KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2" @@ -165,7 +174,10 @@ detect_version() { RELEASE=${RELEASE/_beta} RELEASE=${RELEASE/_rc/-rc} RELEASE=${RELEASE/_pre/-pre} - kernel_is ge 2 6 && RELEASE=${RELEASE/-pre/-git} + # We cannot trivally call kernel_is here, because it calls us to detect the + # version + #kernel_is ge 2 6 && RELEASE=${RELEASE/-pre/-git} + [ $(($KV_MAJOR * 1000 + $KV_MINOR)) -ge 2006 ] && RELEASE=${RELEASE/-pre/-git} RELEASETYPE=${RELEASE//[0-9]} # Now we know that RELEASE is the -rc/-git |