While working on the libre-sources bug, I noticed that some of the kernel sources...
authorRobin H. Johnson <robbat2@gentoo.org>
Mon, 26 Apr 2010 06:44:38 +0000 (06:44 +0000)
committerRobin H. Johnson <robbat2@gentoo.org>
Mon, 26 Apr 2010 06:44:38 +0000 (06:44 +0000)
eclass/kernel-2.eclass

index aa03770c25b10832ffcc0f0ff6f548a2d9055c52..895e279ee0acf1b85cf5c9ed612971b348fdbc07 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.225 2010/04/01 21:12:20 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.226 2010/04/26 06:44:38 robbat2 Exp $
 
 # Description: kernel.eclass rewrite for a clean base regarding the 2.6
 #              series of kernel with back-compatibility for 2.4
@@ -247,7 +247,14 @@ detect_version() {
 }
 
 kernel_is() {
-       [[ -z ${OKV} ]] && detect_version
+       # ALL of these should be set before we can safely continue this function.
+       # some of the sources have in the past had only one set.
+       local v n=0
+       for v in OKV KV_{MAJOR,MINOR,PATCH} ; do [[ -z ${!v} ]] && n=1 ; done
+       [[ $n -eq 1 ]] && detect_version
+       unset v n
+
+       # Now we can continue
        local operator test value x=0 y=0 z=0
 
        case ${1} in