1 |
robbat2 09/09/06 23:04:37 |
2 |
|
3 |
Modified: linux-info.eclass |
4 |
Log: |
5 |
Make get_version quieter over repeated calls. |
6 |
|
7 |
Revision Changes Path |
8 |
1.63 eclass/linux-info.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.63&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.63&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.62&r2=1.63 |
13 |
|
14 |
Index: linux-info.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v |
17 |
retrieving revision 1.62 |
18 |
retrieving revision 1.63 |
19 |
diff -p -w -b -B -u -u -r1.62 -r1.63 |
20 |
--- linux-info.eclass 6 Sep 2009 22:54:58 -0000 1.62 |
21 |
+++ linux-info.eclass 6 Sep 2009 23:04:37 -0000 1.63 |
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.62 2009/09/06 22:54:58 robbat2 Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.63 2009/09/06 23:04:37 robbat2 Exp $ |
27 |
# |
28 |
# Original author: John Mylchreest <johnm@g.o> |
29 |
# Maintainer: kernel-misc@g.o |
30 |
@@ -397,6 +397,9 @@ get_localversion() { |
31 |
echo ${x} |
32 |
} |
33 |
|
34 |
+# internal variable, so we know to only print the warning once |
35 |
+get_version_warning_done= |
36 |
+ |
37 |
# @FUNCTION: get_version |
38 |
# @DESCRIPTION: |
39 |
# It gets the version of the kernel inside KERNEL_DIR and populates the KV_FULL variable |
40 |
@@ -419,14 +422,17 @@ get_version() { |
41 |
unset KV_DIR |
42 |
|
43 |
# KV_DIR will contain the full path to the sources directory we should use |
44 |
+ [ -z "${get_version_warning_done}" ] && \ |
45 |
qeinfo "Determining the location of the kernel source code" |
46 |
[ -h "${KERNEL_DIR}" ] && KV_DIR="$(readlink -f ${KERNEL_DIR})" |
47 |
[ -d "${KERNEL_DIR}" ] && KV_DIR="${KERNEL_DIR}" |
48 |
|
49 |
if [ -z "${KV_DIR}" ] |
50 |
then |
51 |
+ if [ -z "${get_version_warning_done}" ]; then |
52 |
+ get_version_warning_done=1 |
53 |
qeerror "Unable to find kernel sources at ${KERNEL_DIR}" |
54 |
- qeinfo "This package requires Linux sources." |
55 |
+ #qeinfo "This package requires Linux sources." |
56 |
if [ "${KERNEL_DIR}" == "/usr/src/linux" ] ; then |
57 |
qeinfo "Please make sure that ${KERNEL_DIR} points at your running kernel, " |
58 |
qeinfo "(or the kernel you wish to build against)." |
59 |
@@ -434,16 +440,22 @@ get_version() { |
60 |
else |
61 |
qeinfo "Please ensure that the KERNEL_DIR environment variable points at full Linux sources of the kernel you wish to compile against." |
62 |
fi |
63 |
+ fi |
64 |
return 1 |
65 |
fi |
66 |
|
67 |
+ if [ -z "${get_version_warning_done}" ]; then |
68 |
qeinfo "Found kernel source directory:" |
69 |
qeinfo " ${KV_DIR}" |
70 |
+ fi |
71 |
|
72 |
if [ ! -s "${KV_DIR}/Makefile" ] |
73 |
then |
74 |
+ if [ -z "${get_version_warning_done}" ]; then |
75 |
+ get_version_warning_done=1 |
76 |
qeerror "Could not find a Makefile in the kernel source directory." |
77 |
qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources" |
78 |
+ fi |
79 |
return 1 |
80 |
fi |
81 |
|
82 |
@@ -467,8 +479,11 @@ get_version() { |
83 |
|
84 |
if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ] |
85 |
then |
86 |
+ if [ -z "${get_version_warning_done}" ]; then |
87 |
+ get_version_warning_done=1 |
88 |
qeerror "Could not detect kernel version." |
89 |
qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources." |
90 |
+ fi |
91 |
return 1 |
92 |
fi |