summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-01-24 20:47:23 +0000
committerMike Frysinger <vapier@gentoo.org>2013-01-24 20:47:23 +0000
commit1b98c0cd8c08f8df8e77d9fe4e884d45bc58a299 (patch)
treecbe2d3f488b5243911c8ea3ecdf73bdce1ba2b9a /eclass/linux-info.eclass
parentfixed double-prefixed install paths, bug 336528 (diff)
downloadhistorical-1b98c0cd8c08f8df8e77d9fe4e884d45bc58a299.tar.gz
historical-1b98c0cd8c08f8df8e77d9fe4e884d45bc58a299.tar.bz2
historical-1b98c0cd8c08f8df8e77d9fe4e884d45bc58a299.zip
handle more kernel versions like 3.7-trunk-amd64 and add a testsuite for it
Diffstat (limited to 'eclass/linux-info.eclass')
-rw-r--r--eclass/linux-info.eclass15
1 files changed, 9 insertions, 6 deletions
diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index 87c1012be9e8..45bd0f704ea8 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.95 2013/01/16 14:29:01 zmedico Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.96 2013/01/24 20:47:23 vapier Exp $
# @ECLASS: linux-info.eclass
# @MAINTAINER:
@@ -586,11 +586,14 @@ get_running_version() {
get_version
return $?
else
- KV_MAJOR=$(get_version_component_range 1 ${KV_FULL})
- KV_MINOR=$(get_version_component_range 2 ${KV_FULL})
- KV_PATCH=$(get_version_component_range 3 ${KV_FULL})
- KV_PATCH=${KV_PATCH//-*}
- KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}}"
+ # This handles a variety of weird kernel versions. Make sure to update
+ # tests/linux-info:get_running_version.sh if you want to change this.
+ local kv_full=${KV_FULL//[-+_]*}
+ KV_MAJOR=$(get_version_component_range 1 ${kv_full})
+ KV_MINOR=$(get_version_component_range 2 ${kv_full})
+ KV_PATCH=$(get_version_component_range 3 ${kv_full})
+ KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}${KV_PATCH:+.${KV_PATCH}}}"
+ : ${KV_PATCH:=0}
fi
return 0
}