summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2010-04-26 06:44:38 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2010-04-26 06:44:38 +0000
commit86bcdfcd38d3d2edcd46db0c379d25d8ad6c795a (patch)
treee5e060fd9ff21518804ff92b23ef4e21b70f24b3 /eclass
parentx86 stable wrt bug #314065 (diff)
downloadgentoo-2-86bcdfcd38d3d2edcd46db0c379d25d8ad6c795a.tar.gz
gentoo-2-86bcdfcd38d3d2edcd46db0c379d25d8ad6c795a.tar.bz2
gentoo-2-86bcdfcd38d3d2edcd46db0c379d25d8ad6c795a.zip
While working on the libre-sources bug, I noticed that some of the kernel sources ebuilds out there have OKV set, but NOT KV_*, leading kernel_is to always return false. Check all of the variables we need for safety instead.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/kernel-2.eclass11
1 files changed, 9 insertions, 2 deletions
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index aa03770c25b1..895e279ee0ac 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.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