Bug #317297: Some kernel sources packages in overlays have version numbers like ...
authorRobin H. Johnson <robbat2@gentoo.org>
Thu, 20 May 2010 23:11:48 +0000 (23:11 +0000)
committerRobin H. Johnson <robbat2@gentoo.org>
Thu, 20 May 2010 23:11:48 +0000 (23:11 +0000)
eclass/kernel-2.eclass

index 4767cbf750c3ab81b3b2f2f5ac9479058054f5a0..89244b7c0274367407243395de65af967d045faf 100644 (file)
@@ -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