summaryrefslogtreecommitdiff
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
commit9f058cb873f867900d2feb94a5ea23ee3be77e9f (patch)
tree3c7e7b19689006695d6d85cdb0fac687883ab28f /eclass/kernel-2.eclass
parentx86 stable wrt bug #314065 (diff)
downloadhistorical-9f058cb873f867900d2feb94a5ea23ee3be77e9f.tar.gz
historical-9f058cb873f867900d2feb94a5ea23ee3be77e9f.tar.bz2
historical-9f058cb873f867900d2feb94a5ea23ee3be77e9f.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/kernel-2.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