1 |
robbat2 09/09/06 23:24:50 |
2 |
|
3 |
Modified: linux-info.eclass |
4 |
Log: |
5 |
Bug 28330: Provide a function to get the source or running version sanely. |
6 |
|
7 |
Revision Changes Path |
8 |
1.66 eclass/linux-info.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.66&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.66&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.65&r2=1.66 |
13 |
|
14 |
Index: linux-info.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v |
17 |
retrieving revision 1.65 |
18 |
retrieving revision 1.66 |
19 |
diff -p -w -b -B -u -u -r1.65 -r1.66 |
20 |
--- linux-info.eclass 6 Sep 2009 23:16:37 -0000 1.65 |
21 |
+++ linux-info.eclass 6 Sep 2009 23:24:49 -0000 1.66 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 1999-2006 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.65 2009/09/06 23:16:37 robbat2 Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.66 2009/09/06 23:24:49 robbat2 Exp $ |
27 |
# |
28 |
# Original author: John Mylchreest <johnm@g.o> |
29 |
# Maintainer: kernel-misc@g.o |
30 |
@@ -557,6 +557,21 @@ get_running_version() { |
31 |
return 0 |
32 |
} |
33 |
|
34 |
+# This next function is named with the eclass prefix to avoid conflicts with |
35 |
+# some old versionator-like eclass functions. |
36 |
+ |
37 |
+# @FUNCTION: linux-info_get_any_version |
38 |
+# @DESCRIPTION: |
39 |
+# This attempts to find the version of the sources, and otherwise falls back to |
40 |
+# the version of the running kernel. |
41 |
+linux-info_get_any_version() { |
42 |
+ get_version |
43 |
+ if [[ $rc -ne 0 ]]; then |
44 |
+ ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version" |
45 |
+ get_running_version |
46 |
+ fi |
47 |
+} |
48 |
+ |
49 |
|
50 |
# ebuild check functions |
51 |
# --------------------------------------- |
52 |
@@ -807,11 +822,7 @@ check_zlibinflate() { |
53 |
# Force a get_version() call when inherited from linux-mod.eclass and then check if the kernel is configured |
54 |
# to support the options specified in CONFIG_CHECK (if not null) |
55 |
linux-info_pkg_setup() { |
56 |
- get_version |
57 |
- if [[ $rc -ne 0 ]]; then |
58 |
- ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version" |
59 |
- get_running_version |
60 |
- fi |
61 |
+ linux-info_get_any_version |
62 |
|
63 |
if kernel_is 2 4; then |
64 |
if [ "$( gcc-major-version )" -eq "4" ] ; then |