From 1c633099e5040713479083674d810d261279308e Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Thu, 20 May 2010 23:11:48 +0000 Subject: [PATCH] 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. --- eclass/kernel-2.eclass | 16 ++++++++++++++-- 1 file 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 -- 2.26.2