public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2008-01-23 20:58 Daniel Drake (dsd)
  0 siblings, 0 replies; 46+ messages in thread
From: Daniel Drake (dsd) @ 2008-01-23 20:58 UTC (permalink / raw
  To: gentoo-commits

dsd         08/01/23 20:58:09

  Modified:             linux-info.eclass
  Log:
  Fix require_kernel_config call thanks to Pacho Ramos in bug #207207

Revision  Changes    Path
1.54                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.54&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.54&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.53&r2=1.54

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- linux-info.eclass	22 Jan 2008 21:05:31 -0000	1.53
+++ linux-info.eclass	23 Jan 2008 20:58:08 -0000	1.54
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.53 2008/01/22 21:05:31 dsd Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.54 2008/01/23 20:58:08 dsd Exp $
 #
 # Description: This eclass is used as a central eclass for accessing kernel
 #			   related information for sources already installed.
@@ -368,7 +368,7 @@
 
 check_kernel_built() {
 	# if we haven't determined the version yet, we need to
-	require_kernel_config
+	require_configured_kernel
 	get_version
 
 	if [ ! -f "${KV_OUT_DIR}/include/linux/version.h" ]



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2008-03-21 11:11 Daniel Drake (dsd)
  0 siblings, 0 replies; 46+ messages in thread
From: Daniel Drake (dsd) @ 2008-03-21 11:11 UTC (permalink / raw
  To: gentoo-commits

dsd         08/03/21 11:11:28

  Modified:             linux-info.eclass
  Log:
  move get_version call to more sensible place, thanks to Jakub Moc and Sok Ann Yap in bug #213978

Revision  Changes    Path
1.55                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.55&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.55&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.54&r2=1.55

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- linux-info.eclass	23 Jan 2008 20:58:08 -0000	1.54
+++ linux-info.eclass	21 Mar 2008 11:11:27 -0000	1.55
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.54 2008/01/23 20:58:08 dsd Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.55 2008/03/21 11:11:27 dsd Exp $
 #
 # Description: This eclass is used as a central eclass for accessing kernel
 #			   related information for sources already installed.
@@ -404,6 +404,9 @@
 	local	config negate die error reworkmodulenames
 	local	soft_errors_count=0 hard_errors_count=0 config_required=0
 
+	# if we haven't determined the version yet, we need to
+	get_version
+
 	# Determine if we really need a .config. The only time when we don't need
 	# one is when all of the CONFIG_CHECK options are prefixed with "~".
 	for config in ${CONFIG_CHECK}
@@ -425,9 +428,6 @@
 		require_configured_kernel
 	fi
 
-	# if we haven't determined the version yet, we need too.
-	get_version
-
 	einfo "Checking for suitable kernel configuration options..."
 	
 	for config in ${CONFIG_CHECK}



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2008-10-31 22:01 Daniel Drake (dsd)
  0 siblings, 0 replies; 46+ messages in thread
From: Daniel Drake (dsd) @ 2008-10-31 22:01 UTC (permalink / raw
  To: gentoo-commits

dsd         08/10/31 22:01:32

  Modified:             linux-info.eclass
  Log:
  Add documentation from Fabio Rossi in bug #217562

Revision  Changes    Path
1.56                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.56&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.56&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.55&r2=1.56

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- linux-info.eclass	21 Mar 2008 11:11:27 -0000	1.55
+++ linux-info.eclass	31 Oct 2008 22:01:32 -0000	1.56
@@ -1,53 +1,93 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.55 2008/03/21 11:11:27 dsd Exp $
-#
-# Description: This eclass is used as a central eclass for accessing kernel
-#			   related information for sources already installed.
-#			   It is vital for linux-mod to function correctly, and is split
-#			   out so that any ebuild behaviour "templates" are abstracted out
-#			   using additional eclasses.
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.56 2008/10/31 22:01:32 dsd Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
 #
 # Please direct your bugs to the current eclass maintainer :)
 
+# @ECLASS: linux-info.eclass
+# @MAINTAINER:
+# kernel-misc@gentoo.org
+# @BLURB: eclass used for accessing kernel related information
+# @DESCRIPTION:
+# This eclass is used as a central eclass for accessing kernel
+# related information for sources already installed.
+# It is vital for linux-mod.eclass to function correctly, and is split
+# out so that any ebuild behaviour "templates" are abstracted out
+# using additional eclasses.
+
 # A Couple of env vars are available to effect usage of this eclass
 # These are as follows:
+
+# @ECLASS-VARIABLE: KERNEL_DIR
+# @DESCRIPTION:
+# A string containing the directory of the target kernel sources. The default value is
+# "/usr/src/linux"
+
+# @ECLASS-VARIABLE: CONFIG_CHECK
+# @DESCRIPTION:
+# A string containing a list of .config options to check for before
+# proceeding with the install.
+#
+#   e.g.: CONFIG_CHECK="MTRR"
+#
+# You can also check that an option doesn't exist by
+# prepending it with an exclamation mark (!).
+#
+#   e.g.: CONFIG_CHECK="!MTRR"
+#
+# To simply warn about a missing option, prepend a '~'.
+
+# @ECLASS-VARIABLE: ERROR_<CFG>
+# @DESCRIPTION:
+# A string containing the error message to display when the check against CONFIG_CHECK
+# fails. <CFG> should reference the appropriate option used in CONFIG_CHECK.
 #
-# Env Var	Option		Description
-# KERNEL_DIR	<string>	The directory containing kernel the target kernel
-#				sources.
-# CONFIG_CHECK	<string>	a list of .config options to check for before
-#				proceeding with the install. ie: CONFIG_CHECK="MTRR"
-#				You can also check that an option doesn't exist by
-#				prepending it with an exclamation mark (!).
-#				ie: CONFIG_CHECK="!MTRR"
-#				To simply warn about a missing option, prepend a '~'.
-# ERROR_CFG		<string>	The error message to display when the above check
-#				fails. <CFG> should reference the appropriate option
-#				as above. ie: ERROR_MTRR="MTRR exists in the .config
-#				but shouldn't!!"
-# KBUILD_OUTPUT	<string>	This is passed on commandline, or can be set from
-#				the kernel makefile. This contains the directory
-#				which is to be used as the kernel object directory.
+#   e.g.: ERROR_MTRR="MTRR exists in the .config but shouldn't!!"
+
+# @ECLASS-VARIABLE: KBUILD_OUTPUT
+# @DESCRIPTION:
+# A string passed on commandline, or set from the kernel makefile. It contains the directory
+# which is to be used as the kernel object directory.
 
 # There are also a couple of variables which are set by this, and shouldn't be
 # set by hand. These are as follows:
-#
-# Env Var		Option		Description
-# KV_FULL		<string>	The full kernel version. ie: 2.6.9-gentoo-johnm-r1
-# KV_MAJOR		<integer>	The kernel major version. ie: 2
-# KV_MINOR		<integer>	The kernel minor version. ie: 6
-# KV_PATCH		<integer>	The kernel patch version. ie: 9
-# KV_EXTRA		<string>	The kernel EXTRAVERSION. ie: -gentoo
-# KV_LOCAL		<string>	The kernel LOCALVERSION concatenation. ie: -johnm
-# KV_DIR		<string>	The kernel source directory, will be null if
-#					KERNEL_DIR is invalid.
-# KV_OUT_DIR		<string>	The kernel object directory. will be KV_DIR unless
-#					koutput is used. This should be used for referencing
-#					.config.
+
+# @ECLASS-VARIABLE: KV_FULL
+# @DESCRIPTION:
+# A read-only variable. It's a string containing the full kernel version. ie: 2.6.9-gentoo-johnm-r1
+
+# @ECLASS-VARIABLE: KV_MAJOR
+# @DESCRIPTION:
+# A read-only variable. It's an integer containing the kernel major version. ie: 2
+
+# @ECLASS-VARIABLE: KV_MINOR
+# @DESCRIPTION:
+# A read-only variable. It's an integer containing the kernel minor version. ie: 6
+
+# @ECLASS-VARIABLE: KV_PATCH
+# @DESCRIPTION:
+# A read-only variable. It's an integer containing the kernel patch version. ie: 9
+
+# @ECLASS-VARIABLE: KV_EXTRA
+# @DESCRIPTION:
+# A read-only variable. It's a string containing the kernel EXTRAVERSION. ie: -gentoo
+
+# @ECLASS-VARIABLE: KV_LOCAL
+# @DESCRIPTION:
+# A read-only variable. It's a string containing the kernel LOCALVERSION concatenation. ie: -johnm
+
+# @ECLASS-VARIABLE: KV_DIR
+# @DESCRIPTION:
+# A read-only variable. It's a string containing the kernel source directory, will be null if
+# KERNEL_DIR is invalid.
+
+# @ECLASS-VARIABLE: KV_OUT_DIR
+# @DESCRIPTION:
+# A read-only variable. It's a string containing the kernel object directory, will be KV_DIR unless
+# KBUILD_OUTPUT is used. This should be used for referencing .config.
 
 # And to ensure all the weirdness with crosscompile
 inherit toolchain-funcs versionator
@@ -101,9 +141,11 @@
 # File Functions
 # ---------------------------------------
 
-# getfilevar accepts 2 vars as follows:
-# getfilevar <VARIABLE> <CONFIGFILE>
-
+# @FUNCTION: getfilevar
+# @USAGE: variable configfile
+# @RETURN: the value of the variable
+# @DESCRIPTION:
+# It detects the value of the variable defined in the file configfile
 getfilevar() {
 local	ERROR workingdir basefname basedname myARCH="${ARCH}"
 	ERROR=0
@@ -132,10 +174,18 @@
 }
 
 
+# @FUNCTION: linux_config_exists
+# @RETURN: true or false
+# @DESCRIPTION:
+# It returns true if .config exists otherwise false
 linux_config_exists() {
 	[ -s "${KV_OUT_DIR}/.config" ]
 }
 
+# @FUNCTION: require_configured_kernel
+# @DESCRIPTION:
+# This function verifies that the current kernel is configured (it checks against the existence of .config)
+# otherwise it dies.
 require_configured_kernel() {
 	if ! linux_config_exists; then
 		qeerror "Could not find a usable .config in the kernel source directory."
@@ -146,6 +196,11 @@
 	fi
 }
 
+# @FUNCTION: linux_chkconfig_present
+# @USAGE: option
+# @RETURN: true or false
+# @DESCRIPTION:
+# It checks that CONFIG_<option>=y or CONFIG_<option>=n is present in the current kernel .config
 linux_chkconfig_present() {
 local	RESULT
 	require_configured_kernel
@@ -153,6 +208,11 @@
 	[ "${RESULT}" = "m" -o "${RESULT}" = "y" ] && return 0 || return 1
 }
 
+# @FUNCTION: linux_chkconfig_module
+# @USAGE: option
+# @RETURN: true or false
+# @DESCRIPTION:
+# It checks that CONFIG_<option>=m is present in the current kernel .config
 linux_chkconfig_module() {
 local	RESULT
 	require_configured_kernel
@@ -160,6 +220,11 @@
 	[ "${RESULT}" = "m" ] && return 0 || return 1
 }
 
+# @FUNCTION: linux_chkconfig_builtin
+# @USAGE: option
+# @RETURN: true or false
+# @DESCRIPTION:
+# It checks that CONFIG_<option>=y is present in the current kernel .config
 linux_chkconfig_builtin() {
 local	RESULT
 	require_configured_kernel
@@ -167,6 +232,11 @@
 	[ "${RESULT}" = "y" ] && return 0 || return 1
 }
 
+# @FUNCTION: linux_chkconfig_string
+# @USAGE: option
+# @RETURN: CONFIG_<option>
+# @DESCRIPTION:
+# It prints the CONFIG_<option> value of the current kernel .config (it requires a configured kernel).
 linux_chkconfig_string() {
 	require_configured_kernel
 	getfilevar "CONFIG_${1}" "${KV_OUT_DIR}/.config"
@@ -175,15 +245,22 @@
 # Versioning Functions
 # ---------------------------------------
 
-# kernel_is returns true when the version is the same as the passed version
+# @FUNCTION: kernel_is
+# @USAGE: [-lt -gt -le -ge -eq] major_number [minor_number patch_number]
+# @RETURN: true or false
+# @DESCRIPTION:
+# It returns true when the current kernel version satisfies the comparison against the passed version.
+# -eq is the default comparison.
 #
+# @CODE
 # For Example where KV = 2.6.9
-# kernel_is 2 4 	returns false
-# kernel_is 2		returns true
-# kernel_is 2 6		returns true
-# kernel_is 2 6 8	returns false
-# kernel_is 2 6 9	returns true
-#
+# kernel_is 2 4   returns false
+# kernel_is 2     returns true
+# kernel_is 2 6   returns true
+# kernel_is 2 6 8 returns false
+# kernel_is 2 6 9 returns true
+# @CODE
+
 # got the jist yet?
 
 kernel_is() {
@@ -234,6 +311,16 @@
 	echo ${x}
 }
 
+# @FUNCTION: get_version
+# @DESCRIPTION:
+# It gets the version of the kernel inside KERNEL_DIR and populates the KV_FULL variable
+# (if KV_FULL is already set it does nothing).
+#
+# The kernel version variables (KV_MAJOR, KV_MINOR, KV_PATCH, KV_EXTRA and KV_LOCAL) are also set.
+#
+# The KV_DIR is set using the KERNEL_DIR env var, the KV_DIR_OUT is set using a valid
+# KBUILD_OUTPUT (in a decreasing priority list, we look for the env var, makefile var or the
+# symlink /lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build).
 get_version() {
 	local kbuild_output
 
@@ -338,6 +425,10 @@
 	return 0
 }
 
+# @FUNCTION: get_running_version
+# @DESCRIPTION:
+# It gets the version of the current running kernel and the result is the same as get_version() if the
+# function can find the sources.
 get_running_version() {
 	KV_FULL=$(uname -r)
 
@@ -366,6 +457,9 @@
 # ebuild check functions
 # ---------------------------------------
 
+# @FUNCTION: check_kernel_built
+# @DESCRIPTION:
+# This function verifies that the current kernel sources have been already prepared otherwise it dies.
 check_kernel_built() {
 	# if we haven't determined the version yet, we need to
 	require_configured_kernel
@@ -386,6 +480,9 @@
 	fi
 }
 
+# @FUNCTION: check_modules_supported
+# @DESCRIPTION:
+# This function verifies that the current kernel support modules (it checks CONFIG_MODULES=y) otherwise it dies.
 check_modules_supported() {
 	# if we haven't determined the version yet, we need too.
 	require_configured_kernel
@@ -400,6 +497,10 @@
 	fi
 }
 
+# @FUNCTION: check_extra_config
+# @DESCRIPTION:
+# It checks the kernel config options specified by CONFIG_CHECK. It dies only when a required config option (i.e.
+# the prefix ~ is not used) doesn't satisfy the directive.
 check_extra_config() {
 	local	config negate die error reworkmodulenames
 	local	soft_errors_count=0 hard_errors_count=0 config_required=0
@@ -590,7 +691,10 @@
 ################################
 # Default pkg_setup
 # Also used when inheriting linux-mod to force a get_version call
-
+# @FUNCTION: linux-info_pkg_setup
+# @DESCRIPTION:
+# Force a get_version() call when inherited from linux-mod.eclass and then check if the kernel is configured
+# to support the options specified in CONFIG_CHECK (if not null)
 linux-info_pkg_setup() {
 	get_version || die "Unable to calculate Linux Kernel version"
 






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2008-12-03 18:11 Daniel Drake (dsd)
  0 siblings, 0 replies; 46+ messages in thread
From: Daniel Drake (dsd) @ 2008-12-03 18:11 UTC (permalink / raw
  To: gentoo-commits

dsd         08/12/03 18:11:47

  Modified:             linux-info.eclass
  Log:
  avoid changing of directory, reported by Tanktalus in bug #229223

Revision  Changes    Path
1.57                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.57&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.57&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.56&r2=1.57

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- linux-info.eclass	31 Oct 2008 22:01:32 -0000	1.56
+++ linux-info.eclass	3 Dec 2008 18:11:47 -0000	1.57
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.56 2008/10/31 22:01:32 dsd Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.57 2008/12/03 18:11:47 dsd Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -147,7 +147,7 @@
 # @DESCRIPTION:
 # It detects the value of the variable defined in the file configfile
 getfilevar() {
-local	ERROR workingdir basefname basedname myARCH="${ARCH}"
+local	ERROR basefname basedname myARCH="${ARCH}"
 	ERROR=0
 
 	[ -z "${1}" ] && ERROR=1
@@ -159,15 +159,12 @@
 		eerror "getfilevar requires 2 variables, with the second a valid file."
 		eerror "   getfilevar <VARIABLE> <CONFIGFILE>"
 	else
-		workingdir="${PWD}"
 		basefname="$(basename ${2})"
 		basedname="$(dirname ${2})"
 		unset ARCH
 
-		cd "${basedname}"
 		echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
-			make M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null
-		cd "${workingdir}"
+			make -C "${basedname}" M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null
 
 		ARCH=${myARCH}
 	fi






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-01-12 23:04 Markus Meier (maekke)
  0 siblings, 0 replies; 46+ messages in thread
From: Markus Meier (maekke) @ 2009-01-12 23:04 UTC (permalink / raw
  To: gentoo-commits

maekke      09/01/12 23:04:54

  Modified:             linux-info.eclass
  Log:
  whitespace

Revision  Changes    Path
1.58                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.58&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.58&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.57&r2=1.58

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- linux-info.eclass	3 Dec 2008 18:11:47 -0000	1.57
+++ linux-info.eclass	12 Jan 2009 23:04:54 -0000	1.58
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.57 2008/12/03 18:11:47 dsd Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.58 2009/01/12 23:04:54 maekke Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -527,7 +527,7 @@
 	fi
 
 	einfo "Checking for suitable kernel configuration options..."
-	
+
 	for config in ${CONFIG_CHECK}
 	do
 		# if we specify any fatal, ensure we honor them






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-03-27 20:13 Peter Alfredsen (loki_val)
  0 siblings, 0 replies; 46+ messages in thread
From: Peter Alfredsen (loki_val) @ 2009-03-27 20:13 UTC (permalink / raw
  To: gentoo-commits

loki_val    09/03/27 20:13:04

  Modified:             linux-info.eclass
  Log:
  Fix obvious typo in comments. Thanks to zlin for noticing.

Revision  Changes    Path
1.59                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.59&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.59&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.58&r2=1.59

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- linux-info.eclass	12 Jan 2009 23:04:54 -0000	1.58
+++ linux-info.eclass	27 Mar 2009 20:13:04 -0000	1.59
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.58 2009/01/12 23:04:54 maekke Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.59 2009/03/27 20:13:04 loki_val Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -197,7 +197,7 @@
 # @USAGE: option
 # @RETURN: true or false
 # @DESCRIPTION:
-# It checks that CONFIG_<option>=y or CONFIG_<option>=n is present in the current kernel .config
+# It checks that CONFIG_<option>=y or CONFIG_<option>=m is present in the current kernel .config
 linux_chkconfig_present() {
 local	RESULT
 	require_configured_kernel






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-07-04 18:39 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-07-04 18:39 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/07/04 18:39:34

  Modified:             linux-info.eclass
  Log:
  If we need to perform an optional kernel config check, and there are no configured kernel sources present, just warn the user rather than being totally silent.

Revision  Changes    Path
1.60                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.60&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.60&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.59&r2=1.60

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.59
retrieving revision 1.60
diff -p -w -b -B -u -u -r1.59 -r1.60
--- linux-info.eclass	27 Mar 2009 20:13:04 -0000	1.59
+++ linux-info.eclass	4 Jul 2009 18:39:33 -0000	1.60
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.59 2009/03/27 20:13:04 loki_val Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.60 2009/07/04 18:39:33 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -520,6 +520,12 @@ check_extra_config() {
 		# if the user has no .config as there is nothing to do. Otherwise
 		# code later will cause a failure due to missing .config.
 		if ! linux_config_exists; then
+			ewarn "Unable to check for the following kernel config options due"
+			ewarn "to absence of any configured kernel sources:"
+			for config in ${CONFIG_CHECK}; do
+				ewarn " - ${config#\~}"
+			done
+			ewarn "You're on your own to make sure they are set if needed."
 			return 0
 		fi
 	else






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-08-30 22:37 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-08-30 22:37 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/08/30 22:37:07

  Modified:             linux-info.eclass
  Log:
  Implement a variant of getfilevar that does not use Make to fetch the variable, and thusly does not fail out due to missing dependancies. Also fix totally broken checks in check_zlibinflate, that called a non-existing function.

Revision  Changes    Path
1.61                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.61&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.61&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.60&r2=1.61

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.60
retrieving revision 1.61
diff -p -w -b -B -u -u -r1.60 -r1.61
--- linux-info.eclass	4 Jul 2009 18:39:33 -0000	1.60
+++ linux-info.eclass	30 Aug 2009 22:37:06 -0000	1.61
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.60 2009/07/04 18:39:33 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.61 2009/08/30 22:37:06 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -145,7 +145,9 @@ qeerror() { qout eerror "${@}" ; }
 # @USAGE: variable configfile
 # @RETURN: the value of the variable
 # @DESCRIPTION:
-# It detects the value of the variable defined in the file configfile
+# It detects the value of the variable defined in the file configfile. This is
+# done by including the configfile, and printing the variable with Make.
+# It WILL break if your makefile has missing dependencies!
 getfilevar() {
 local	ERROR basefname basedname myARCH="${ARCH}"
 	ERROR=0
@@ -170,6 +172,36 @@ local	ERROR basefname basedname myARCH="
 	fi
 }
 
+# @FUNCTION: getfilevar_noexec
+# @USAGE: variable configfile
+# @RETURN: the value of the variable
+# @DESCRIPTION:
+# It detects the value of the variable defined in the file configfile.
+# This is done with sed matching an expression only. If the variable is defined,
+# you will run into problems. See getfilevar for those cases.
+getfilevar_noexec() {
+local	ERROR basefname basedname myARCH="${ARCH}"
+	ERROR=0
+
+	[ -z "${1}" ] && ERROR=1
+	[ ! -f "${2}" ] && ERROR=1
+
+	if [ "${ERROR}" = 1 ]
+	then
+		echo -e "\n"
+		eerror "getfilevar_noexec requires 2 variables, with the second a valid file."
+		eerror "   getfilevar_noexec <VARIABLE> <CONFIGFILE>"
+	else
+		sed -n \
+		-e "/^[[:space:]]*${1}[[:space:]]*=[[:space:]]*\(.*\)\$/{ 
+			s,^[^=]*[[:space:]]*=[[:space:]]*,,g ;
+			s,[[:space:]]*\$,,g ;
+			p
+		}" \
+		"${2}"
+	fi
+}
+
 
 # @FUNCTION: linux_config_exists
 # @RETURN: true or false
@@ -201,7 +233,7 @@ require_configured_kernel() {
 linux_chkconfig_present() {
 local	RESULT
 	require_configured_kernel
-	RESULT="$(getfilevar CONFIG_${1} ${KV_OUT_DIR}/.config)"
+	RESULT="$(getfilevar_noexec CONFIG_${1} ${KV_OUT_DIR}/.config)"
 	[ "${RESULT}" = "m" -o "${RESULT}" = "y" ] && return 0 || return 1
 }
 
@@ -213,7 +245,7 @@ local	RESULT
 linux_chkconfig_module() {
 local	RESULT
 	require_configured_kernel
-	RESULT="$(getfilevar CONFIG_${1} ${KV_OUT_DIR}/.config)"
+	RESULT="$(getfilevar_noexec CONFIG_${1} ${KV_OUT_DIR}/.config)"
 	[ "${RESULT}" = "m" ] && return 0 || return 1
 }
 
@@ -225,7 +257,7 @@ local	RESULT
 linux_chkconfig_builtin() {
 local	RESULT
 	require_configured_kernel
-	RESULT="$(getfilevar CONFIG_${1} ${KV_OUT_DIR}/.config)"
+	RESULT="$(getfilevar_noexec CONFIG_${1} ${KV_OUT_DIR}/.config)"
 	[ "${RESULT}" = "y" ] && return 0 || return 1
 }
 
@@ -236,7 +268,7 @@ local	RESULT
 # It prints the CONFIG_<option> value of the current kernel .config (it requires a configured kernel).
 linux_chkconfig_string() {
 	require_configured_kernel
-	getfilevar "CONFIG_${1}" "${KV_OUT_DIR}/.config"
+	getfilevar_noexec "CONFIG_${1}" "${KV_OUT_DIR}/.config"
 }
 
 # Versioning Functions
@@ -365,16 +397,16 @@ get_version() {
 	OUTPUT_DIR="${OUTPUT_DIR:-${KBUILD_OUTPUT}}"
 
 	# And if we didn't pass it, we can take a nosey in the Makefile
-	kbuild_output="$(getfilevar KBUILD_OUTPUT ${KV_DIR}/Makefile)"
+	kbuild_output="$(getfilevar_noexec KBUILD_OUTPUT ${KV_DIR}/Makefile)"
 	OUTPUT_DIR="${OUTPUT_DIR:-${kbuild_output}}"
 
 	# And contrary to existing functions I feel we shouldn't trust the
 	# directory name to find version information as this seems insane.
 	# so we parse ${KV_DIR}/Makefile
-	KV_MAJOR="$(getfilevar VERSION ${KV_DIR}/Makefile)"
-	KV_MINOR="$(getfilevar PATCHLEVEL ${KV_DIR}/Makefile)"
-	KV_PATCH="$(getfilevar SUBLEVEL ${KV_DIR}/Makefile)"
-	KV_EXTRA="$(getfilevar EXTRAVERSION ${KV_DIR}/Makefile)"
+	KV_MAJOR="$(getfilevar_noexec VERSION ${KV_DIR}/Makefile)"
+	KV_MINOR="$(getfilevar_noexec PATCHLEVEL ${KV_DIR}/Makefile)"
+	KV_PATCH="$(getfilevar_noexec SUBLEVEL ${KV_DIR}/Makefile)"
+	KV_EXTRA="$(getfilevar_noexec EXTRAVERSION ${KV_DIR}/Makefile)"
 
 	if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ]
 	then
@@ -641,12 +673,12 @@ check_zlibinflate() {
 	einfo "Determining the usability of ZLIB_INFLATE support in your kernel"
 
 	ebegin "checking ZLIB_INFLATE"
-	getfilevar_isbuiltin CONFIG_ZLIB_INFLATE ${KV_DIR}/.config
+	linux_chkconfig_builtin CONFIG_ZLIB_INFLATE
 	eend $?
 	[ "$?" != 0 ] && die
 
 	ebegin "checking ZLIB_DEFLATE"
-	getfilevar_isbuiltin CONFIG_ZLIB_DEFLATE ${KV_DIR}/.config
+	linux_chkconfig_builtin CONFIG_ZLIB_DEFLATE
 	eend $?
 	[ "$?" != 0 ] && die
 






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-09-06 22:54 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-09-06 22:54 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/09/06 22:54:58

  Modified:             linux-info.eclass
  Log:
  Bug #283320: Part of the migration work to make linux-info non-fatal. Currently gets enabled with I_KNOW_WHAT_I_AM_DOING in the env for the .config reading. Also uses the currently running version if no sources at all available.

Revision  Changes    Path
1.62                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.62&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.62&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.61&r2=1.62

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.61
retrieving revision 1.62
diff -p -w -b -B -u -u -r1.61 -r1.62
--- linux-info.eclass	30 Aug 2009 22:37:06 -0000	1.61
+++ linux-info.eclass	6 Sep 2009 22:54:58 -0000	1.62
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.61 2009/08/30 22:37:06 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.62 2009/09/06 22:54:58 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -13,10 +13,14 @@
 # @BLURB: eclass used for accessing kernel related information
 # @DESCRIPTION:
 # This eclass is used as a central eclass for accessing kernel
-# related information for sources already installed.
+# related information for source or binary already installed.
 # It is vital for linux-mod.eclass to function correctly, and is split
 # out so that any ebuild behaviour "templates" are abstracted out
 # using additional eclasses.
+#
+# "kernel config" in this file means:
+# The .config of the currently installed sources is used as the first
+# preference, with a fall-back to bundled config (/proc/config.gz) if available.
 
 # A Couple of env vars are available to effect usage of this eclass
 # These are as follows:
@@ -39,6 +43,14 @@
 #   e.g.: CONFIG_CHECK="!MTRR"
 #
 # To simply warn about a missing option, prepend a '~'.
+# It may be combined with '!'.
+#
+# In general, most checks should be non-fatal. The only time fatal checks should
+# be used is for building kernel modules or cases that a compile will fail
+# without the option.
+#
+# This is to allow usage of binary kernels, and minimal systems without kernel
+# sources.
 
 # @ECLASS-VARIABLE: ERROR_<CFG>
 # @DESCRIPTION:
@@ -89,6 +101,10 @@
 # A read-only variable. It's a string containing the kernel object directory, will be KV_DIR unless
 # KBUILD_OUTPUT is used. This should be used for referencing .config.
 
+# @ECLASS-VARIABLE: I_KNOW_WHAT_I_AM_DOING
+# @DESCRIPTION:
+# Temporary variable for the migration to making linux-info non-fatal.
+
 # And to ensure all the weirdness with crosscompile
 inherit toolchain-funcs versionator
 
@@ -180,11 +196,13 @@ local	ERROR basefname basedname myARCH="
 # This is done with sed matching an expression only. If the variable is defined,
 # you will run into problems. See getfilevar for those cases.
 getfilevar_noexec() {
-local	ERROR basefname basedname myARCH="${ARCH}"
+	local	ERROR basefname basedname mycat myARCH="${ARCH}"
 	ERROR=0
+	mycat='cat'
 
 	[ -z "${1}" ] && ERROR=1
 	[ ! -f "${2}" ] && ERROR=1
+	[ "${2#.gz}" != "${2}" ] && mycat='zcat'
 
 	if [ "${ERROR}" = 1 ]
 	then
@@ -192,23 +210,42 @@ local	ERROR basefname basedname myARCH="
 		eerror "getfilevar_noexec requires 2 variables, with the second a valid file."
 		eerror "   getfilevar_noexec <VARIABLE> <CONFIGFILE>"
 	else
+		${mycat} "${2}" | \
 		sed -n \
 		-e "/^[[:space:]]*${1}[[:space:]]*=[[:space:]]*\(.*\)\$/{ 
 			s,^[^=]*[[:space:]]*=[[:space:]]*,,g ;
 			s,[[:space:]]*\$,,g ;
 			p
-		}" \
-		"${2}"
+		}"
 	fi
 }
 
 
+# @FUNCTION: linux_config_src_exists
+# @RETURN: true or false
+# @DESCRIPTION:
+# It returns true if .config exists in a build directory otherwise false
+linux_config_src_exists() {
+	[ -s "${KV_OUT_DIR}/.config" ]
+}
+
+# @FUNCTION: linux_config_bin_exists
+# @RETURN: true or false
+# @DESCRIPTION:
+# It returns true if .config exists in /proc, otherwise false
+linux_config_bin_exists() {
+	[ -s "/proc/config.gz" ]
+}
+
 # @FUNCTION: linux_config_exists
 # @RETURN: true or false
 # @DESCRIPTION:
 # It returns true if .config exists otherwise false
+#
+# This function MUST be checked before using any of the linux_chkconfig_*
+# functions.
 linux_config_exists() {
-	[ -s "${KV_OUT_DIR}/.config" ]
+	linux_config_src_exists || linux_config_bin_exists
 }
 
 # @FUNCTION: require_configured_kernel
@@ -216,7 +253,7 @@ linux_config_exists() {
 # This function verifies that the current kernel is configured (it checks against the existence of .config)
 # otherwise it dies.
 require_configured_kernel() {
-	if ! linux_config_exists; then
+	if ! linux_config_src_exists; then
 		qeerror "Could not find a usable .config in the kernel source directory."
 		qeerror "Please ensure that ${KERNEL_DIR} points to a configured set of Linux sources."
 		qeerror "If you are using KBUILD_OUTPUT, please set the environment var so that"
@@ -230,10 +267,15 @@ require_configured_kernel() {
 # @RETURN: true or false
 # @DESCRIPTION:
 # It checks that CONFIG_<option>=y or CONFIG_<option>=m is present in the current kernel .config
+# If linux_config_exists returns false, the results of this are UNDEFINED. You
+# MUST call linux_config_exists first.
 linux_chkconfig_present() {
 local	RESULT
-	require_configured_kernel
-	RESULT="$(getfilevar_noexec CONFIG_${1} ${KV_OUT_DIR}/.config)"
+	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
+	local config
+	config="${KV_OUT_DIR}/.config"
+	[ ! -f "${config}" ] && config="/proc/config.gz"
+	RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
 	[ "${RESULT}" = "m" -o "${RESULT}" = "y" ] && return 0 || return 1
 }
 
@@ -242,10 +284,15 @@ local	RESULT
 # @RETURN: true or false
 # @DESCRIPTION:
 # It checks that CONFIG_<option>=m is present in the current kernel .config
+# If linux_config_exists returns false, the results of this are UNDEFINED. You
+# MUST call linux_config_exists first.
 linux_chkconfig_module() {
 local	RESULT
-	require_configured_kernel
-	RESULT="$(getfilevar_noexec CONFIG_${1} ${KV_OUT_DIR}/.config)"
+	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
+	local config
+	config="${KV_OUT_DIR}/.config"
+	[ ! -f "${config}" ] && config="/proc/config.gz"
+	RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
 	[ "${RESULT}" = "m" ] && return 0 || return 1
 }
 
@@ -254,10 +301,15 @@ local	RESULT
 # @RETURN: true or false
 # @DESCRIPTION:
 # It checks that CONFIG_<option>=y is present in the current kernel .config
+# If linux_config_exists returns false, the results of this are UNDEFINED. You
+# MUST call linux_config_exists first.
 linux_chkconfig_builtin() {
 local	RESULT
-	require_configured_kernel
-	RESULT="$(getfilevar_noexec CONFIG_${1} ${KV_OUT_DIR}/.config)"
+	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
+	local config
+	config="${KV_OUT_DIR}/.config"
+	[ ! -f "${config}" ] && config="/proc/config.gz"
+	RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
 	[ "${RESULT}" = "y" ] && return 0 || return 1
 }
 
@@ -266,9 +318,14 @@ local	RESULT
 # @RETURN: CONFIG_<option>
 # @DESCRIPTION:
 # It prints the CONFIG_<option> value of the current kernel .config (it requires a configured kernel).
+# If linux_config_exists returns false, the results of this are UNDEFINED. You
+# MUST call linux_config_exists first.
 linux_chkconfig_string() {
-	require_configured_kernel
-	getfilevar_noexec "CONFIG_${1}" "${KV_OUT_DIR}/.config"
+	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
+	local config
+	config="${KV_OUT_DIR}/.config"
+	[ ! -f "${config}" ] && config="/proc/config.gz"
+	getfilevar_noexec "CONFIG_${1}" "${config}"
 }
 
 # Versioning Functions
@@ -731,7 +788,11 @@ check_zlibinflate() {
 # Force a get_version() call when inherited from linux-mod.eclass and then check if the kernel is configured
 # to support the options specified in CONFIG_CHECK (if not null)
 linux-info_pkg_setup() {
-	get_version || die "Unable to calculate Linux Kernel version"
+	get_version 
+	if [[ $rc -ne 0 ]]; then
+		ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version"
+		get_running_version 
+	fi
 
 	if kernel_is 2 4; then
 		if [ "$( gcc-major-version )" -eq "4" ] ; then






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-09-06 23:04 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-09-06 23:04 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/09/06 23:04:37

  Modified:             linux-info.eclass
  Log:
  Make get_version quieter over repeated calls.

Revision  Changes    Path
1.63                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.63&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.63&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.62&r2=1.63

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.62
retrieving revision 1.63
diff -p -w -b -B -u -u -r1.62 -r1.63
--- linux-info.eclass	6 Sep 2009 22:54:58 -0000	1.62
+++ linux-info.eclass	6 Sep 2009 23:04:37 -0000	1.63
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.62 2009/09/06 22:54:58 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.63 2009/09/06 23:04:37 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -397,6 +397,9 @@ get_localversion() {
 	echo ${x}
 }
 
+# internal variable, so we know to only print the warning once
+get_version_warning_done=
+
 # @FUNCTION: get_version
 # @DESCRIPTION:
 # It gets the version of the kernel inside KERNEL_DIR and populates the KV_FULL variable
@@ -419,14 +422,17 @@ get_version() {
 	unset KV_DIR
 
 	# KV_DIR will contain the full path to the sources directory we should use
+	[ -z "${get_version_warning_done}" ] && \
 	qeinfo "Determining the location of the kernel source code"
 	[ -h "${KERNEL_DIR}" ] && KV_DIR="$(readlink -f ${KERNEL_DIR})"
 	[ -d "${KERNEL_DIR}" ] && KV_DIR="${KERNEL_DIR}"
 
 	if [ -z "${KV_DIR}" ]
 	then
+		if [ -z "${get_version_warning_done}" ]; then
+			get_version_warning_done=1
 		qeerror "Unable to find kernel sources at ${KERNEL_DIR}"
-		qeinfo "This package requires Linux sources."
+			#qeinfo "This package requires Linux sources."
 		if [ "${KERNEL_DIR}" == "/usr/src/linux" ] ; then
 			qeinfo "Please make sure that ${KERNEL_DIR} points at your running kernel, "
 			qeinfo "(or the kernel you wish to build against)."
@@ -434,16 +440,22 @@ get_version() {
 		else
 			qeinfo "Please ensure that the KERNEL_DIR environment variable points at full Linux sources of the kernel you wish to compile against."
 		fi
+		fi
 		return 1
 	fi
 
+	if [ -z "${get_version_warning_done}" ]; then
 	qeinfo "Found kernel source directory:"
 	qeinfo "    ${KV_DIR}"
+	fi
 
 	if [ ! -s "${KV_DIR}/Makefile" ]
 	then
+		if [ -z "${get_version_warning_done}" ]; then
+			get_version_warning_done=1
 		qeerror "Could not find a Makefile in the kernel source directory."
 		qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources"
+		fi
 		return 1
 	fi
 
@@ -467,8 +479,11 @@ get_version() {
 
 	if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ]
 	then
+		if [ -z "${get_version_warning_done}" ]; then
+			get_version_warning_done=1
 		qeerror "Could not detect kernel version."
 		qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources."
+		fi
 		return 1
 	fi
 






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-09-06 23:12 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-09-06 23:12 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/09/06 23:12:29

  Modified:             linux-info.eclass
  Log:
  Bug 283320: Fix minor typo for config.gz. Improve ewarn output, more migration.

Revision  Changes    Path
1.64                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.64&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.64&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.63&r2=1.64

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.63
retrieving revision 1.64
diff -p -w -b -B -u -u -r1.63 -r1.64
--- linux-info.eclass	6 Sep 2009 23:04:37 -0000	1.63
+++ linux-info.eclass	6 Sep 2009 23:12:29 -0000	1.64
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.63 2009/09/06 23:04:37 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.64 2009/09/06 23:12:29 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -202,7 +202,7 @@ getfilevar_noexec() {
 
 	[ -z "${1}" ] && ERROR=1
 	[ ! -f "${2}" ] && ERROR=1
-	[ "${2#.gz}" != "${2}" ] && mycat='zcat'
+	[ "${2%.gz}" != "${2}" ] && mycat='zcat'
 
 	if [ "${ERROR}" = 1 ]
 	then
@@ -625,7 +625,8 @@ check_extra_config() {
 		# code later will cause a failure due to missing .config.
 		if ! linux_config_exists; then
 			ewarn "Unable to check for the following kernel config options due"
-			ewarn "to absence of any configured kernel sources:"
+			ewarn "to absence of any configured kernel sources or compiled"
+			ewarn "config:"
 			for config in ${CONFIG_CHECK}; do
 				ewarn " - ${config#\~}"
 			done
@@ -633,7 +634,7 @@ check_extra_config() {
 			return 0
 		fi
 	else
-		require_configured_kernel
+		[ -n "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	fi
 
 	einfo "Checking for suitable kernel configuration options..."






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-09-06 23:24 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-09-06 23:24 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/09/06 23:24:50

  Modified:             linux-info.eclass
  Log:
  Bug 28330: Provide a function to get the source or running version sanely.

Revision  Changes    Path
1.66                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.66&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.66&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.65&r2=1.66

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.65
retrieving revision 1.66
diff -p -w -b -B -u -u -r1.65 -r1.66
--- linux-info.eclass	6 Sep 2009 23:16:37 -0000	1.65
+++ linux-info.eclass	6 Sep 2009 23:24:49 -0000	1.66
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.65 2009/09/06 23:16:37 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.66 2009/09/06 23:24:49 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -557,6 +557,21 @@ get_running_version() {
 	return 0
 }
 
+# This next function is named with the eclass prefix to avoid conflicts with
+# some old versionator-like eclass functions.
+
+# @FUNCTION: linux-info_get_any_version
+# @DESCRIPTION:
+# This attempts to find the version of the sources, and otherwise falls back to
+# the version of the running kernel.
+linux-info_get_any_version() {
+	get_version 
+	if [[ $rc -ne 0 ]]; then
+		ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version"
+		get_running_version 
+	fi
+}
+
 
 # ebuild check functions
 # ---------------------------------------
@@ -807,11 +822,7 @@ check_zlibinflate() {
 # Force a get_version() call when inherited from linux-mod.eclass and then check if the kernel is configured
 # to support the options specified in CONFIG_CHECK (if not null)
 linux-info_pkg_setup() {
-	get_version 
-	if [[ $rc -ne 0 ]]; then
-		ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version"
-		get_running_version 
-	fi
+	linux-info_get_any_version
 
 	if kernel_is 2 4; then
 		if [ "$( gcc-major-version )" -eq "4" ] ; then






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-09-06 23:31 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-09-06 23:31 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/09/06 23:31:47

  Modified:             linux-info.eclass
  Log:
  Bug 283320: Minor bug from the refactoring.

Revision  Changes    Path
1.67                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.67&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.67&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.66&r2=1.67

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.66
retrieving revision 1.67
diff -p -w -b -B -u -u -r1.66 -r1.67
--- linux-info.eclass	6 Sep 2009 23:24:49 -0000	1.66
+++ linux-info.eclass	6 Sep 2009 23:31:47 -0000	1.67
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.66 2009/09/06 23:24:49 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.67 2009/09/06 23:31:47 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -566,7 +566,7 @@ get_running_version() {
 # the version of the running kernel.
 linux-info_get_any_version() {
 	get_version 
-	if [[ $rc -ne 0 ]]; then
+	if [[ $? -ne 0 ]]; then
 		ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version"
 		get_running_version 
 	fi






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-09-06 23:36 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-09-06 23:36 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/09/06 23:36:04

  Modified:             linux-info.eclass
  Log:
  Match the function prototype that allows "-OP" form, which matches the bash versions.

Revision  Changes    Path
1.68                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.68&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.68&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.67&r2=1.68

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.67
retrieving revision 1.68
diff -p -w -b -B -u -u -r1.67 -r1.68
--- linux-info.eclass	6 Sep 2009 23:31:47 -0000	1.67
+++ linux-info.eclass	6 Sep 2009 23:36:04 -0000	1.68
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.67 2009/09/06 23:31:47 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.68 2009/09/06 23:36:04 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -358,11 +358,11 @@ kernel_is() {
 	local operator test value x=0 y=0 z=0
 
 	case ${1} in
-	  lt) operator="-lt"; shift;;
-	  gt) operator="-gt"; shift;;
-	  le) operator="-le"; shift;;
-	  ge) operator="-ge"; shift;;
-	  eq) operator="-eq"; shift;;
+	  -lt|lt) operator="-lt"; shift;;
+	  -gt|gt) operator="-gt"; shift;;
+	  -le|le) operator="-le"; shift;;
+	  -ge|ge) operator="-ge"; shift;;
+	  -eq|eq) operator="-eq"; shift;;
 	   *) operator="-eq";;
 	esac
 






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-09-06 23:40 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-09-06 23:40 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/09/06 23:40:48

  Modified:             linux-info.eclass
  Log:
  Bug 28330: Fix two instances where we want any version, not just the sources version.

Revision  Changes    Path
1.69                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.69&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.69&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.68&r2=1.69

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.68
retrieving revision 1.69
diff -p -w -b -B -u -u -r1.68 -r1.69
--- linux-info.eclass	6 Sep 2009 23:36:04 -0000	1.68
+++ linux-info.eclass	6 Sep 2009 23:40:48 -0000	1.69
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.68 2009/09/06 23:36:04 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.69 2009/09/06 23:40:48 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -354,7 +354,8 @@ linux_chkconfig_string() {
 
 kernel_is() {
 	# if we haven't determined the version yet, we need to.
-	get_version
+	linux-info_get_any_version
+
 	local operator test value x=0 y=0 z=0
 
 	case ${1} in
@@ -625,7 +626,7 @@ check_extra_config() {
 	local	soft_errors_count=0 hard_errors_count=0 config_required=0
 
 	# if we haven't determined the version yet, we need to
-	get_version
+	linux-mod_get_any_version
 
 	# Determine if we really need a .config. The only time when we don't need
 	# one is when all of the CONFIG_CHECK options are prefixed with "~".






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-09-06 23:41 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-09-06 23:41 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/09/06 23:41:42

  Modified:             linux-info.eclass
  Log:
  Typo in the last commit.

Revision  Changes    Path
1.70                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.70&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.70&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.69&r2=1.70

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.69
retrieving revision 1.70
diff -p -w -b -B -u -u -r1.69 -r1.70
--- linux-info.eclass	6 Sep 2009 23:40:48 -0000	1.69
+++ linux-info.eclass	6 Sep 2009 23:41:42 -0000	1.70
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.69 2009/09/06 23:40:48 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.70 2009/09/06 23:41:42 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -626,7 +626,7 @@ check_extra_config() {
 	local	soft_errors_count=0 hard_errors_count=0 config_required=0
 
 	# if we haven't determined the version yet, we need to
-	linux-mod_get_any_version
+	linux-info_get_any_version
 
 	# Determine if we really need a .config. The only time when we don't need
 	# one is when all of the CONFIG_CHECK options are prefixed with "~".






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-09-08 12:34 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-09-08 12:34 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/09/08 12:34:21

  Modified:             linux-info.eclass
  Log:
  get_version should use linux_config_src_exists to check for source.

Revision  Changes    Path
1.71                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.71&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.71&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.70&r2=1.71

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.70
retrieving revision 1.71
diff -p -w -b -B -u -u -r1.70 -r1.71
--- linux-info.eclass	6 Sep 2009 23:41:42 -0000	1.70
+++ linux-info.eclass	8 Sep 2009 12:34:21 -0000	1.71
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.70 2009/09/06 23:41:42 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.71 2009/09/08 12:34:21 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -511,7 +511,7 @@ get_version() {
 	KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}"
 
 	KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
-	if linux_config_exists; then
+	if linux_config_src_exists; then
 		KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)"
 		KV_LOCAL="${KV_LOCAL//\"/}"
 






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-09-13 20:44 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-09-13 20:44 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/09/13 20:44:11

  Modified:             linux-info.eclass
  Log:
  One backwards compatability fix while we are working on checking all ebuilds for the linux-info change.

Revision  Changes    Path
1.72                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.72&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.72&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.71&r2=1.72

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.71
retrieving revision 1.72
diff -p -w -b -B -u -u -r1.71 -r1.72
--- linux-info.eclass	8 Sep 2009 12:34:21 -0000	1.71
+++ linux-info.eclass	13 Sep 2009 20:44:11 -0000	1.72
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.71 2009/09/08 12:34:21 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.72 2009/09/13 20:44:11 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -638,11 +638,13 @@ check_extra_config() {
 		fi
 	done
 
+	# TODO: After we enable the new code for /proc/config.gz, we need to
+	# change this back to linux_config_exists.
 	if [[ ${config_required} == 0 ]]; then
 		# In the case where we don't require a .config, we can now bail out
 		# if the user has no .config as there is nothing to do. Otherwise
 		# code later will cause a failure due to missing .config.
-		if ! linux_config_exists; then
+		if ! linux_config_src_exists; then
 			ewarn "Unable to check for the following kernel config options due"
 			ewarn "to absence of any configured kernel sources or compiled"
 			ewarn "config:"






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-10-11 11:48 Markus Meier (maekke)
  0 siblings, 0 replies; 46+ messages in thread
From: Markus Meier (maekke) @ 2009-10-11 11:48 UTC (permalink / raw
  To: gentoo-commits

maekke      09/10/11 11:48:33

  Modified:             linux-info.eclass
  Log:
  whitespace

Revision  Changes    Path
1.73                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.73&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.73&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.72&r2=1.73

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- linux-info.eclass	13 Sep 2009 20:44:11 -0000	1.72
+++ linux-info.eclass	11 Oct 2009 11:48:33 -0000	1.73
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.72 2009/09/13 20:44:11 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.73 2009/10/11 11:48:33 maekke Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -382,7 +382,7 @@
 		  *) die "Error in kernel-2_kernel_is(): Too many parameters.";;
 		esac
 	done
-	
+
 	[ ${test} ${operator} ${value} ] && return 0 || return 1
 }
 
@@ -566,10 +566,10 @@
 # This attempts to find the version of the sources, and otherwise falls back to
 # the version of the running kernel.
 linux-info_get_any_version() {
-	get_version 
+	get_version
 	if [[ $? -ne 0 ]]; then
 		ewarn "Unable to calculate Linux Kernel version for build, attempting to use running version"
-		get_running_version 
+		get_running_version
 	fi
 }
 






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-12-11 20:42 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-12-11 20:42 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/12/11 20:42:51

  Modified:             linux-info.eclass
  Log:
  Better legacy-mode support for linux-info until the migration is completed, thanks to darkside_ for finding the issue.

Revision  Changes    Path
1.74                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.74&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.74&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.73&r2=1.74

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.73
retrieving revision 1.74
diff -p -w -b -B -u -u -r1.73 -r1.74
--- linux-info.eclass	11 Oct 2009 11:48:33 -0000	1.73
+++ linux-info.eclass	11 Dec 2009 20:42:51 -0000	1.74
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.73 2009/10/11 11:48:33 maekke Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.74 2009/12/11 20:42:51 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -237,7 +237,7 @@ linux_config_src_exists() {
 # @DESCRIPTION:
 # It returns true if .config exists in /proc, otherwise false
 linux_config_bin_exists() {
-	[ -s "/proc/config.gz" ]
+	[ -n "${I_KNOW_WHAT_I_AM_DOING}" -a -s "/proc/config.gz" ]
 }
 
 # @FUNCTION: linux_config_exists






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-12-11 20:54 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-12-11 20:54 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/12/11 20:54:06

  Modified:             linux-info.eclass
  Log:
  Add a QA warning if you call linux_chkconfig* and linux_config* was not called.

Revision  Changes    Path
1.75                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.75&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.75&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.74&r2=1.75

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.74
retrieving revision 1.75
diff -p -w -b -B -u -u -r1.74 -r1.75
--- linux-info.eclass	11 Dec 2009 20:42:51 -0000	1.74
+++ linux-info.eclass	11 Dec 2009 20:54:06 -0000	1.75
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.74 2009/12/11 20:42:51 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.75 2009/12/11 20:54:06 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -223,12 +223,28 @@ getfilevar_noexec() {
 	fi
 }
 
+# @PRIVATE-VARIABLE: _LINUX_CONFIG_EXISTS_DONE
+# @DESCRIPTION:
+# This is only set if one of the linux_config_*exists functions has been called.
+# We use it for a QA warning that the check for a config has not been performed,
+# as linux_chkconfig* in non-legacy mode WILL return an undefined value if no
+# config is available at all.
+_LINUX_CONFIG_EXISTS_DONE=
+
+linux_config_qa_check() {
+	local funcname="$1"
+	if [ -z "${_LINUX_CONFIG_EXISTS_DONE}" ]; then
+		ewarn "QA: You called $1 before any linux_config_exists!"
+		ewarn "QA: The return value of $1 will NOT gaurenteed later!"
+	fi
+}
 
 # @FUNCTION: linux_config_src_exists
 # @RETURN: true or false
 # @DESCRIPTION:
 # It returns true if .config exists in a build directory otherwise false
 linux_config_src_exists() {
+	export _LINUX_CONFIG_EXISTS_DONE=1
 	[ -s "${KV_OUT_DIR}/.config" ]
 }
 
@@ -237,6 +253,7 @@ linux_config_src_exists() {
 # @DESCRIPTION:
 # It returns true if .config exists in /proc, otherwise false
 linux_config_bin_exists() {
+	export _LINUX_CONFIG_EXISTS_DONE=1
 	[ -n "${I_KNOW_WHAT_I_AM_DOING}" -a -s "/proc/config.gz" ]
 }
 
@@ -273,6 +290,7 @@ require_configured_kernel() {
 # If linux_config_exists returns false, the results of this are UNDEFINED. You
 # MUST call linux_config_exists first.
 linux_chkconfig_present() {
+	linux_config_qa_check
 local	RESULT
 	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	local config
@@ -290,6 +308,7 @@ local	RESULT
 # If linux_config_exists returns false, the results of this are UNDEFINED. You
 # MUST call linux_config_exists first.
 linux_chkconfig_module() {
+	linux_config_qa_check
 local	RESULT
 	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	local config
@@ -307,6 +326,7 @@ local	RESULT
 # If linux_config_exists returns false, the results of this are UNDEFINED. You
 # MUST call linux_config_exists first.
 linux_chkconfig_builtin() {
+	linux_config_qa_check
 local	RESULT
 	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	local config
@@ -324,6 +344,7 @@ local	RESULT
 # If linux_config_exists returns false, the results of this are UNDEFINED. You
 # MUST call linux_config_exists first.
 linux_chkconfig_string() {
+	linux_config_qa_check
 	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	local config
 	config="${KV_OUT_DIR}/.config"
@@ -624,6 +645,10 @@ check_modules_supported() {
 check_extra_config() {
 	local	config negate die error reworkmodulenames
 	local	soft_errors_count=0 hard_errors_count=0 config_required=0
+	# store the value of the QA check, because otherwise we won't catch usages
+	# after if check_extra_config is called AND other direct calls are done
+	# later.
+	local   old_LINUX_CONFIG_EXISTS_DONE="${_LINUX_CONFIG_EXISTS_DONE}"
 
 	# if we haven't determined the version yet, we need to
 	linux-info_get_any_version
@@ -652,6 +677,7 @@ check_extra_config() {
 				ewarn " - ${config#\~}"
 			done
 			ewarn "You're on your own to make sure they are set if needed."
+			export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
 			return 0
 		fi
 	else
@@ -738,6 +764,7 @@ check_extra_config() {
 		eerror "Failure to do so may cause unexpected problems."
 		eerror "Once you have satisfied these options, please try merging"
 		eerror "this package again."
+		export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
 		die "Incorrect kernel configuration options"
 	elif [[ ${soft_errors_count} > 0 ]]; then
 		ewarn "Please check to make sure these options are set correctly."
@@ -745,6 +772,7 @@ check_extra_config() {
 	else
 		eend 0
 	fi
+	export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"
 }
 
 check_zlibinflate() {






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2009-12-11 21:33 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2009-12-11 21:33 UTC (permalink / raw
  To: gentoo-commits

robbat2     09/12/11 21:33:30

  Modified:             linux-info.eclass
  Log:
  Forgot the argument for the nice output of the QA check.

Revision  Changes    Path
1.76                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.76&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.76&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.75&r2=1.76

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.75
retrieving revision 1.76
diff -p -w -b -B -u -u -r1.75 -r1.76
--- linux-info.eclass	11 Dec 2009 20:54:06 -0000	1.75
+++ linux-info.eclass	11 Dec 2009 21:33:30 -0000	1.76
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.75 2009/12/11 20:54:06 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.76 2009/12/11 21:33:30 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -232,10 +232,10 @@ getfilevar_noexec() {
 _LINUX_CONFIG_EXISTS_DONE=
 
 linux_config_qa_check() {
-	local funcname="$1"
+	local f="$1"
 	if [ -z "${_LINUX_CONFIG_EXISTS_DONE}" ]; then
-		ewarn "QA: You called $1 before any linux_config_exists!"
-		ewarn "QA: The return value of $1 will NOT gaurenteed later!"
+		ewarn "QA: You called $f before any linux_config_exists!"
+		ewarn "QA: The return value of $f will NOT gaurenteed later!"
 	fi
 }
 
@@ -290,7 +290,7 @@ require_configured_kernel() {
 # If linux_config_exists returns false, the results of this are UNDEFINED. You
 # MUST call linux_config_exists first.
 linux_chkconfig_present() {
-	linux_config_qa_check
+	linux_config_qa_check linux_chkconfig_present
 	local	RESULT
 	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	local config
@@ -308,7 +308,7 @@ linux_chkconfig_present() {
 # If linux_config_exists returns false, the results of this are UNDEFINED. You
 # MUST call linux_config_exists first.
 linux_chkconfig_module() {
-	linux_config_qa_check
+	linux_config_qa_check linux_chkconfig_module
 	local	RESULT
 	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	local config
@@ -326,7 +326,7 @@ linux_chkconfig_module() {
 # If linux_config_exists returns false, the results of this are UNDEFINED. You
 # MUST call linux_config_exists first.
 linux_chkconfig_builtin() {
-	linux_config_qa_check
+	linux_config_qa_check linux_chkconfig_builtin
 	local	RESULT
 	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	local config
@@ -344,7 +344,7 @@ linux_chkconfig_builtin() {
 # If linux_config_exists returns false, the results of this are UNDEFINED. You
 # MUST call linux_config_exists first.
 linux_chkconfig_string() {
-	linux_config_qa_check
+	linux_config_qa_check linux_chkconfig_string
 	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	local config
 	config="${KV_OUT_DIR}/.config"






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2010-01-10  8:25 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2010-01-10  8:25 UTC (permalink / raw
  To: gentoo-commits

robbat2     10/01/10 08:25:55

  Modified:             linux-info.eclass
  Log:
  Display any configured warning or error message along with the list of config options when we cannot detect a config.

Revision  Changes    Path
1.77                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.77&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.77&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.76&r2=1.77

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.76
retrieving revision 1.77
diff -p -w -b -B -u -u -r1.76 -r1.77
--- linux-info.eclass	11 Dec 2009 21:33:30 -0000	1.76
+++ linux-info.eclass	10 Jan 2010 08:25:55 -0000	1.77
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.76 2009/12/11 21:33:30 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.77 2010/01/10 08:25:55 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -674,7 +674,13 @@ check_extra_config() {
 			ewarn "to absence of any configured kernel sources or compiled"
 			ewarn "config:"
 			for config in ${CONFIG_CHECK}; do
-				ewarn " - ${config#\~}"
+				local_error="ERROR_${config#\~}"
+				msg="${!local_error}"
+				if [[ "x${msg}" == "x" ]]; then
+					local_error="WARNING_${config#\~}"
+					msg="${!local_error}"
+				fi
+				ewarn " - ${config#\~}${msg:+ - }${msg}"
 			done
 			ewarn "You're on your own to make sure they are set if needed."
 			export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}"






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2010-01-10  8:47 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2010-01-10  8:47 UTC (permalink / raw
  To: gentoo-commits

robbat2     10/01/10 08:47:02

  Modified:             linux-info.eclass
  Log:
  Bug #300306, #167385: One side effect of the non-exec check version for the kernel makefile is that it did not pick up appends, breaking builds on some patched kernels. Try the exec version first now, with a fallback.

Revision  Changes    Path
1.78                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.78&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.78&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.77&r2=1.78

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.77
retrieving revision 1.78
diff -p -w -b -B -u -u -r1.77 -r1.78
--- linux-info.eclass	10 Jan 2010 08:25:55 -0000	1.77
+++ linux-info.eclass	10 Jan 2010 08:47:01 -0000	1.78
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.77 2010/01/10 08:25:55 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.78 2010/01/10 08:47:01 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -490,17 +490,32 @@ get_version() {
 	# do we pass KBUILD_OUTPUT on the CLI?
 	OUTPUT_DIR="${OUTPUT_DIR:-${KBUILD_OUTPUT}}"
 
+	# keep track of it
+	KERNEL_MAKEFILE="${KV_DIR}/Makefile"
+
+	# Check if the Makefile is valid for direct parsing.
+	# Check status results:
+	# - PASS, use 'getfilevar' to extract values
+	# - FAIL, use 'getfilevar_noexec' to extract values
+	# The check may fail if:
+	# - make is not present
+	# - corruption exists in the kernel makefile
+	local a='' b='' mkfunc='getfilevar'
+	a="$(getfilevar VERSION ${KERNEL_MAKEFILE})"
+	b="$(getfilevar_noexec VERSION ${KERNEL_MAKEFILE})"
+	[[ "${a}" != "${b}" ]] && mkfunc='getfilevar_noexec'
+
 	# And if we didn't pass it, we can take a nosey in the Makefile
-	kbuild_output="$(getfilevar_noexec KBUILD_OUTPUT ${KV_DIR}/Makefile)"
+	kbuild_output="$(${mkfunc} KBUILD_OUTPUT ${KERNEL_MAKEFILE})"
 	OUTPUT_DIR="${OUTPUT_DIR:-${kbuild_output}}"
 
 	# And contrary to existing functions I feel we shouldn't trust the
 	# directory name to find version information as this seems insane.
-	# so we parse ${KV_DIR}/Makefile
-	KV_MAJOR="$(getfilevar_noexec VERSION ${KV_DIR}/Makefile)"
-	KV_MINOR="$(getfilevar_noexec PATCHLEVEL ${KV_DIR}/Makefile)"
-	KV_PATCH="$(getfilevar_noexec SUBLEVEL ${KV_DIR}/Makefile)"
-	KV_EXTRA="$(getfilevar_noexec EXTRAVERSION ${KV_DIR}/Makefile)"
+	# so we parse ${KERNEL_MAKEFILE}
+	KV_MAJOR="$(${mkfunc} VERSION ${KERNEL_MAKEFILE})"
+	KV_MINOR="$(${mkfunc} PATCHLEVEL ${KERNEL_MAKEFILE})"
+	KV_PATCH="$(${mkfunc} SUBLEVEL ${KERNEL_MAKEFILE})"
+	KV_EXTRA="$(${mkfunc} EXTRAVERSION ${KERNEL_MAKEFILE})"
 
 	if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ]
 	then






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2010-01-10  9:01 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2010-01-10  9:01 UTC (permalink / raw
  To: gentoo-commits

robbat2     10/01/10 09:01:38

  Modified:             linux-info.eclass
  Log:
  Bug #283320: major change now, as warned about 1 month ago in http://thread.gmane.org/gmane.linux.gentoo.devel/64125. ALL linux_chkconfig calls MUST be preceeded by a linux_config*exists function. CONFIG_CHECK warning mode (~) no longer requires existence of kernel sources or any configuration. The eclass no longer introduces linux-sources into the dependency tree.

Revision  Changes    Path
1.79                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.79&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.79&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.78&r2=1.79

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.78
retrieving revision 1.79
diff -p -w -b -B -u -u -r1.78 -r1.79
--- linux-info.eclass	10 Jan 2010 08:47:01 -0000	1.78
+++ linux-info.eclass	10 Jan 2010 09:01:38 -0000	1.79
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.78 2010/01/10 08:47:01 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.79 2010/01/10 09:01:38 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -101,10 +101,6 @@
 # A read-only variable. It's a string containing the kernel object directory, will be KV_DIR unless
 # KBUILD_OUTPUT is used. This should be used for referencing .config.
 
-# @ECLASS-VARIABLE: I_KNOW_WHAT_I_AM_DOING
-# @DESCRIPTION:
-# Temporary variable for the migration to making linux-info non-fatal.
-
 # And to ensure all the weirdness with crosscompile
 inherit toolchain-funcs versionator
 
@@ -113,9 +109,6 @@ EXPORT_FUNCTIONS pkg_setup
 DEPEND=""
 RDEPEND=""
 
-[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && \
-DEPEND="kernel_linux? ( virtual/linux-sources )"
-
 # Overwritable environment Var's
 # ---------------------------------------
 KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}"
@@ -254,7 +247,7 @@ linux_config_src_exists() {
 # It returns true if .config exists in /proc, otherwise false
 linux_config_bin_exists() {
 	export _LINUX_CONFIG_EXISTS_DONE=1
-	[ -n "${I_KNOW_WHAT_I_AM_DOING}" -a -s "/proc/config.gz" ]
+	[ -s "/proc/config.gz" ]
 }
 
 # @FUNCTION: linux_config_exists
@@ -292,7 +285,6 @@ require_configured_kernel() {
 linux_chkconfig_present() {
 	linux_config_qa_check linux_chkconfig_present
 	local	RESULT
-	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	local config
 	config="${KV_OUT_DIR}/.config"
 	[ ! -f "${config}" ] && config="/proc/config.gz"
@@ -310,7 +302,6 @@ linux_chkconfig_present() {
 linux_chkconfig_module() {
 	linux_config_qa_check linux_chkconfig_module
 	local	RESULT
-	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	local config
 	config="${KV_OUT_DIR}/.config"
 	[ ! -f "${config}" ] && config="/proc/config.gz"
@@ -328,7 +319,6 @@ linux_chkconfig_module() {
 linux_chkconfig_builtin() {
 	linux_config_qa_check linux_chkconfig_builtin
 	local	RESULT
-	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	local config
 	config="${KV_OUT_DIR}/.config"
 	[ ! -f "${config}" ] && config="/proc/config.gz"
@@ -345,7 +335,6 @@ linux_chkconfig_builtin() {
 # MUST call linux_config_exists first.
 linux_chkconfig_string() {
 	linux_config_qa_check linux_chkconfig_string
-	[ -z "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
 	local config
 	config="${KV_OUT_DIR}/.config"
 	[ ! -f "${config}" ] && config="/proc/config.gz"
@@ -678,13 +667,11 @@ check_extra_config() {
 		fi
 	done
 
-	# TODO: After we enable the new code for /proc/config.gz, we need to
-	# change this back to linux_config_exists.
 	if [[ ${config_required} == 0 ]]; then
 		# In the case where we don't require a .config, we can now bail out
 		# if the user has no .config as there is nothing to do. Otherwise
 		# code later will cause a failure due to missing .config.
-		if ! linux_config_src_exists; then
+		if ! linux_config_exists; then
 			ewarn "Unable to check for the following kernel config options due"
 			ewarn "to absence of any configured kernel sources or compiled"
 			ewarn "config:"
@@ -702,7 +689,7 @@ check_extra_config() {
 			return 0
 		fi
 	else
-		[ -n "${I_KNOW_WHAT_I_AM_DOING}" ] && require_configured_kernel
+		require_configured_kernel
 	fi
 
 	einfo "Checking for suitable kernel configuration options..."






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2010-01-10  9:25 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2010-01-10  9:25 UTC (permalink / raw
  To: gentoo-commits

robbat2     10/01/10 09:25:13

  Modified:             linux-info.eclass
  Log:
  Inside kernel_is, use a non-keyword for the variable name, and quote the actual check at the end.

Revision  Changes    Path
1.80                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.80&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.80&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.79&r2=1.80

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.79
retrieving revision 1.80
diff -p -w -b -B -u -u -r1.79 -r1.80
--- linux-info.eclass	10 Jan 2010 09:01:38 -0000	1.79
+++ linux-info.eclass	10 Jan 2010 09:25:12 -0000	1.80
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.79 2010/01/10 09:01:38 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.80 2010/01/10 09:25:12 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -366,7 +366,7 @@ kernel_is() {
 	# if we haven't determined the version yet, we need to.
 	linux-info_get_any_version
 
-	local operator test value x=0 y=0 z=0
+	local operator testagainst value x=0 y=0 z=0
 
 	case ${1} in
 	  -lt|lt) operator="-lt"; shift;;
@@ -383,17 +383,17 @@ kernel_is() {
 		z=$((${z} + 1))
 
 		case ${z} in
-		  1) for((y=0; y<$((3 - ${#KV_MAJOR})); y++)); do test="${test}0"; done;
-		     test="${test}${KV_MAJOR}";;
-		  2) for((y=0; y<$((3 - ${#KV_MINOR})); y++)); do test="${test}0"; done;
-		     test="${test}${KV_MINOR}";;
-		  3) for((y=0; y<$((3 - ${#KV_PATCH})); y++)); do test="${test}0"; done;
-		     test="${test}${KV_PATCH}";;
+		  1) for((y=0; y<$((3 - ${#KV_MAJOR})); y++)); do testagainst="${testagainst}0"; done;
+		     testagainst="${testagainst}${KV_MAJOR}";;
+		  2) for((y=0; y<$((3 - ${#KV_MINOR})); y++)); do testagainst="${testagainst}0"; done;
+		     testagainst="${testagainst}${KV_MINOR}";;
+		  3) for((y=0; y<$((3 - ${#KV_PATCH})); y++)); do testagainst="${testagainst}0"; done;
+		     testagainst="${testagainst}${KV_PATCH}";;
 		  *) die "Error in kernel-2_kernel_is(): Too many parameters.";;
 		esac
 	done
 
-	[ ${test} ${operator} ${value} ] && return 0 || return 1
+	[ "${testagainst}" ${operator} "${value}" ] && return 0 || return 1
 }
 
 get_localversion() {






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2010-01-10  9:26 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2010-01-10  9:26 UTC (permalink / raw
  To: gentoo-commits

robbat2     10/01/10 09:26:09

  Modified:             linux-info.eclass
  Log:
  Bug #286145: More flexible logic for OUTPUT_DIR defaults.

Revision  Changes    Path
1.81                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.81&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.81&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.80&r2=1.81

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.80
retrieving revision 1.81
diff -p -w -b -B -u -u -r1.80 -r1.81
--- linux-info.eclass	10 Jan 2010 09:25:12 -0000	1.80
+++ linux-info.eclass	10 Jan 2010 09:26:09 -0000	1.81
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.80 2010/01/10 09:25:12 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.81 2010/01/10 09:26:09 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -520,7 +520,6 @@ get_version() {
 	# but before we do this, we need to find if we use a different object directory.
 	# This *WILL* break if the user is using localversions, but we assume it was
 	# caught before this if they are.
-	[ "${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}" == "$(uname -r)" ] && \
 		OUTPUT_DIR="${OUTPUT_DIR:-/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build}"
 
 	[ -h "${OUTPUT_DIR}" ] && KV_OUT_DIR="$(readlink -f ${OUTPUT_DIR})"






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2010-01-17 21:34 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2010-01-17 21:34 UTC (permalink / raw
  To: gentoo-commits

robbat2     10/01/17 21:34:52

  Modified:             linux-info.eclass
  Log:
  Merge first part of patch from bug #87242: New warning output method and support for another assignment type in makefile non-exec parsing.

Revision  Changes    Path
1.82                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.82&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.82&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.81&r2=1.82

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.81
retrieving revision 1.82
diff -p -w -b -B -u -u -r1.81 -r1.82
--- linux-info.eclass	10 Jan 2010 09:26:09 -0000	1.81
+++ linux-info.eclass	17 Jan 2010 21:34:52 -0000	1.82
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.81 2010/01/10 09:26:09 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.82 2010/01/17 21:34:52 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -148,6 +148,7 @@ qout() {
 }
 
 qeinfo() { qout einfo "${@}" ; }
+qewarn() { qout ewarn "${@}" ; }
 qeerror() { qout eerror "${@}" ; }
 
 # File Functions
@@ -208,7 +209,7 @@ getfilevar_noexec() {
 	else
 		${mycat} "${2}" | \
 		sed -n \
-		-e "/^[[:space:]]*${1}[[:space:]]*=[[:space:]]*\(.*\)\$/{ 
+		-e "/^[[:space:]]*${1}[[:space:]]*:\\?=[[:space:]]*\(.*\)\$/{ 
 			s,^[^=]*[[:space:]]*=[[:space:]]*,,g ;
 			s,[[:space:]]*\$,,g ;
 			p






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2010-01-17 21:46 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2010-01-17 21:46 UTC (permalink / raw
  To: gentoo-commits

robbat2     10/01/17 21:46:55

  Modified:             linux-info.eclass
  Log:
  Factor out the function used to validate the makefile for the extraction method.

Revision  Changes    Path
1.83                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.83&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?rev=1.83&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/linux-info.eclass?r1=1.82&r2=1.83

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.82
retrieving revision 1.83
diff -p -w -b -B -u -u -r1.82 -r1.83
--- linux-info.eclass	17 Jan 2010 21:34:52 -0000	1.82
+++ linux-info.eclass	17 Jan 2010 21:46:55 -0000	1.83
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.82 2010/01/17 21:34:52 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.83 2010/01/17 21:46:55 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -412,6 +412,21 @@ get_localversion() {
 	echo ${x}
 }
 
+# Check if the Makefile is valid for direct parsing.
+# Check status results:
+# - PASS, use 'getfilevar' to extract values
+# - FAIL, use 'getfilevar_noexec' to extract values
+# The check may fail if:
+# - make is not present
+# - corruption exists in the kernel makefile
+get_makefile_extract_function() {
+	local a='' b='' mkfunc='getfilevar'
+	a="$(getfilevar VERSION ${KERNEL_MAKEFILE})"
+	b="$(getfilevar_noexec VERSION ${KERNEL_MAKEFILE})"
+	[[ "${a}" != "${b}" ]] && mkfunc='getfilevar_noexec'
+	echo "${mkfunc}"
+}
+
 # internal variable, so we know to only print the warning once
 get_version_warning_done=
 
@@ -426,7 +441,7 @@ get_version_warning_done=
 # KBUILD_OUTPUT (in a decreasing priority list, we look for the env var, makefile var or the
 # symlink /lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build).
 get_version() {
-	local kbuild_output
+	local kbuild_output mkfunc
 
 	# no need to execute this twice assuming KV_FULL is populated.
 	# we can force by unsetting KV_FULL
@@ -483,17 +498,8 @@ get_version() {
 	# keep track of it
 	KERNEL_MAKEFILE="${KV_DIR}/Makefile"
 
-	# Check if the Makefile is valid for direct parsing.
-	# Check status results:
-	# - PASS, use 'getfilevar' to extract values
-	# - FAIL, use 'getfilevar_noexec' to extract values
-	# The check may fail if:
-	# - make is not present
-	# - corruption exists in the kernel makefile
-	local a='' b='' mkfunc='getfilevar'
-	a="$(getfilevar VERSION ${KERNEL_MAKEFILE})"
-	b="$(getfilevar_noexec VERSION ${KERNEL_MAKEFILE})"
-	[[ "${a}" != "${b}" ]] && mkfunc='getfilevar_noexec'
+	# Decide the function used to extract makefile variables.
+	mkfunc="$(get_makefile_extract_function "${KERNEL_MAKEFILE}")"
 
 	# And if we didn't pass it, we can take a nosey in the Makefile
 	kbuild_output="$(${mkfunc} KBUILD_OUTPUT ${KERNEL_MAKEFILE})"






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2010-06-17 23:46 Jonathan Callen (abcd)
  0 siblings, 0 replies; 46+ messages in thread
From: Jonathan Callen (abcd) @ 2010-06-17 23:46 UTC (permalink / raw
  To: gentoo-commits

abcd        10/06/17 23:46:25

  Modified:             linux-info.eclass
  Log:
  Add better support for finding out-of-tree builds when searching in /lib/modules

Revision  Changes    Path
1.84                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.84&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.84&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.83&r2=1.84

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- linux-info.eclass	17 Jan 2010 21:46:55 -0000	1.83
+++ linux-info.eclass	17 Jun 2010 23:46:25 -0000	1.84
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.83 2010/01/17 21:46:55 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.84 2010/06/17 23:46:25 abcd Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -568,7 +568,13 @@
 get_running_version() {
 	KV_FULL=$(uname -r)
 
-	if [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile ]]; then
+	if [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile && -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then
+		KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source)
+		KBUILD_OUTPUT=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build)
+		unset KV_FULL
+		get_version
+		return $?
+	elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile ]]; then
 		KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source)
 		unset KV_FULL
 		get_version






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2010-08-03  7:03 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2010-08-03  7:03 UTC (permalink / raw
  To: gentoo-commits

robbat2     10/08/03 07:03:39

  Modified:             linux-info.eclass
  Log:
  Bug #323717: Newer kernels change the build of localversion a lot, so we need to keep up with the times.

Revision  Changes    Path
1.85                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.85&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.85&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.84&r2=1.85

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.84
retrieving revision 1.85
diff -p -w -b -B -u -u -r1.84 -r1.85
--- linux-info.eclass	17 Jun 2010 23:46:25 -0000	1.84
+++ linux-info.eclass	3 Aug 2010 07:03:39 -0000	1.85
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.84 2010/06/17 23:46:25 abcd Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.85 2010/08/03 07:03:39 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -535,21 +535,28 @@ get_version() {
 	then
 		qeinfo "Found kernel object directory:"
 		qeinfo "    ${KV_OUT_DIR}"
-
-		KV_LOCAL="$(get_localversion ${KV_OUT_DIR})"
 	fi
 	# and if we STILL have not got it, then we better just set it to KV_DIR
 	KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}"
 
-	KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
 	if linux_config_src_exists; then
-		KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)"
+		# For things like git that can append extra stuff:
+		# This script is NOT posix-compliant. Running it with 'sh' when 'sh'
+		# is a real POSIX shell causes some breakages (bug #323717).
+		if [ -e ${KV_DIR}/scripts/setlocalversion ] ; then
+			KV_LOCAL="${KV_LOCAL}$(cd ${KV_OUT_DIR} ; bash ${KV_DIR}/scripts/setlocalversion ${KV_DIR})"
+		else
+			# localversion* files
+			KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
+
+			# CONFIG_LOCALVERSION + LOCALVERSION
+			KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)${LOCALVERSION}"
 		KV_LOCAL="${KV_LOCAL//\"/}"
 
-		# For things like git that can append extra stuff:
-		[ -e ${KV_DIR}/scripts/setlocalversion ] &&
-			linux_chkconfig_builtin LOCALVERSION_AUTO &&
-			KV_LOCAL="${KV_LOCAL}$(sh ${KV_DIR}/scripts/setlocalversion ${KV_DIR})"
+			# CONFIG_LOCALVERSION_AUTO logic ???
+		fi
+	else
+		KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
 	fi
 
 	# And we should set KV_FULL to the full expanded version






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2010-08-05 21:57 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2010-08-05 21:57 UTC (permalink / raw
  To: gentoo-commits

robbat2     10/08/05 21:57:53

  Modified:             linux-info.eclass
  Log:
  Bug #323717 again: Merge patch from Nick Bowler <nbowler@draconx.ca> to handle localversion differently so that it should work on more kernels. Note that if the kernel.release file is out of date however, it will install modules to the wrong location now.

Revision  Changes    Path
1.86                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.86&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.86&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.85&r2=1.86

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.85
retrieving revision 1.86
diff -p -w -b -B -u -u -r1.85 -r1.86
--- linux-info.eclass	3 Aug 2010 07:03:39 -0000	1.85
+++ linux-info.eclass	5 Aug 2010 21:57:53 -0000	1.86
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.85 2010/08/03 07:03:39 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.86 2010/08/05 21:57:53 robbat2 Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -441,7 +441,7 @@ get_version_warning_done=
 # KBUILD_OUTPUT (in a decreasing priority list, we look for the env var, makefile var or the
 # symlink /lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build).
 get_version() {
-	local kbuild_output mkfunc
+	local kbuild_output mkfunc tmplocal
 
 	# no need to execute this twice assuming KV_FULL is populated.
 	# we can force by unsetting KV_FULL
@@ -539,24 +539,28 @@ get_version() {
 	# and if we STILL have not got it, then we better just set it to KV_DIR
 	KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}"
 
-	if linux_config_src_exists; then
-		# For things like git that can append extra stuff:
-		# This script is NOT posix-compliant. Running it with 'sh' when 'sh'
-		# is a real POSIX shell causes some breakages (bug #323717).
-		if [ -e ${KV_DIR}/scripts/setlocalversion ] ; then
-			KV_LOCAL="${KV_LOCAL}$(cd ${KV_OUT_DIR} ; bash ${KV_DIR}/scripts/setlocalversion ${KV_DIR})"
+	# Grab the kernel release from the output directory.
+	# TODO: we MUST detect kernel.release being out of date, and 'return 1' from
+	# this function.
+	if [ -s "${KV_OUT_DIR}"/include/config/kernel.release ]; then
+		KV_LOCAL=$(<"${KV_OUT_DIR}"/include/config/kernel.release)
+	elif [ -s "${KV_OUT_DIR}"/.kernelrelease ]; then
+		KV_LOCAL=$(<"${KV_OUT_DIR}"/.kernelrelease)
 		else
-			# localversion* files
-			KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
+		KV_LOCAL=
+	fi
 
-			# CONFIG_LOCALVERSION + LOCALVERSION
-			KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)${LOCALVERSION}"
-			KV_LOCAL="${KV_LOCAL//\"/}"
+	# KV_LOCAL currently contains the full release; discard the first bits.
+	tmplocal=${KV_LOCAL#${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}}
 
-			# CONFIG_LOCALVERSION_AUTO logic ???
-		fi
+	# If the updated local version was not changed, the tree is not prepared.
+	# Clear out KV_LOCAL in that case.
+	# TODO: this does not detect a change in the localversion part between
+	# kernel.release and the value that would be generated.
+	if [ "$KV_LOCAL" = "$tmplocal" ]; then
+		KV_LOCAL=
 	else
-		KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
+		KV_LOCAL=$tmplocal
 	fi
 
 	# And we should set KV_FULL to the full expanded version






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2011-01-04 17:53 Doug Goldstein (cardoe)
  0 siblings, 0 replies; 46+ messages in thread
From: Doug Goldstein (cardoe) @ 2011-01-04 17:53 UTC (permalink / raw
  To: gentoo-commits

cardoe      11/01/04 17:53:13

  Modified:             linux-info.eclass
  Log:
  Fix a spelling typo.

Revision  Changes    Path
1.87                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.87&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.87&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.86&r2=1.87

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- linux-info.eclass	5 Aug 2010 21:57:53 -0000	1.86
+++ linux-info.eclass	4 Jan 2011 17:53:13 -0000	1.87
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.86 2010/08/05 21:57:53 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.87 2011/01/04 17:53:13 cardoe Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -229,7 +229,7 @@
 	local f="$1"
 	if [ -z "${_LINUX_CONFIG_EXISTS_DONE}" ]; then
 		ewarn "QA: You called $f before any linux_config_exists!"
-		ewarn "QA: The return value of $f will NOT gaurenteed later!"
+		ewarn "QA: The return value of $f will NOT guaranteed later!"
 	fi
 }
 






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2011-03-29 19:57 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 46+ messages in thread
From: Diego Petteno (flameeyes) @ 2011-03-29 19:57 UTC (permalink / raw
  To: gentoo-commits

flameeyes    11/03/29 19:57:51

  Modified:             linux-info.eclass
  Log:
  Fix build with stable release kernels when sources are not available.
  
  Without this change, it will keep the '.y' value appended to KV_PATCH causing kernel_is function to fail.
  Closes bug #293395.

Revision  Changes    Path
1.88                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.88&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.88&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.87&r2=1.88

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -r1.87 -r1.88
--- linux-info.eclass	4 Jan 2011 17:53:13 -0000	1.87
+++ linux-info.eclass	29 Mar 2011 19:57:51 -0000	1.88
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.87 2011/01/04 17:53:13 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.88 2011/03/29 19:57:51 flameeyes Exp $
 #
 # Original author: John Mylchreest <johnm@gentoo.org>
 # Maintainer: kernel-misc@gentoo.org
@@ -598,10 +598,9 @@
 	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=$(get_version_component_range 3 ${KV_FULL})
 		KV_PATCH=${KV_PATCH//-*}
-		[[ -n ${KV_FULL#*-} ]] && [[ -n ${KV_FULL//${KV_FULL#*-}} ]] \
-			&& KV_EXTRA="-${KV_FULL#*-}"
+		KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}}"
 	fi
 	return 0
 }






^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2013-01-14 21:19 Mike Frysinger (vapier)
  0 siblings, 0 replies; 46+ messages in thread
From: Mike Frysinger (vapier) @ 2013-01-14 21:19 UTC (permalink / raw
  To: gentoo-commits

vapier      13/01/14 21:19:39

  Modified:             linux-info.eclass
  Log:
  fix up style -- no tabs after `local`

Revision  Changes    Path
1.94                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.94&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.94&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.93&r2=1.94

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- linux-info.eclass	22 Oct 2012 19:00:52 -0000	1.93
+++ linux-info.eclass	14 Jan 2013 21:19:39 -0000	1.94
@@ -1,6 +1,6 @@
 # Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.93 2012/10/22 19:00:52 mpagano Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.94 2013/01/14 21:19:39 vapier Exp $
 
 # @ECLASS: linux-info.eclass
 # @MAINTAINER:
@@ -167,7 +167,7 @@
 # done by including the configfile, and printing the variable with Make.
 # It WILL break if your makefile has missing dependencies!
 getfilevar() {
-local	ERROR basefname basedname myARCH="${ARCH}"
+	local ERROR basefname basedname myARCH="${ARCH}"
 	ERROR=0
 
 	[ -z "${1}" ] && ERROR=1
@@ -198,7 +198,7 @@
 # This is done with sed matching an expression only. If the variable is defined,
 # you will run into problems. See getfilevar for those cases.
 getfilevar_noexec() {
-	local	ERROR basefname basedname mycat myARCH="${ARCH}"
+	local ERROR basefname basedname mycat myARCH="${ARCH}"
 	ERROR=0
 	mycat='cat'
 
@@ -291,8 +291,7 @@
 # MUST call linux_config_exists first.
 linux_chkconfig_present() {
 	linux_config_qa_check linux_chkconfig_present
-	local	RESULT
-	local config
+	local RESULT config
 	config="${KV_OUT_DIR}/.config"
 	[ ! -f "${config}" ] && config="/proc/config.gz"
 	RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
@@ -308,8 +307,7 @@
 # MUST call linux_config_exists first.
 linux_chkconfig_module() {
 	linux_config_qa_check linux_chkconfig_module
-	local	RESULT
-	local config
+	local RESULT config
 	config="${KV_OUT_DIR}/.config"
 	[ ! -f "${config}" ] && config="/proc/config.gz"
 	RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
@@ -325,8 +323,7 @@
 # MUST call linux_config_exists first.
 linux_chkconfig_builtin() {
 	linux_config_qa_check linux_chkconfig_builtin
-	local	RESULT
-	local config
+	localRESULT config
 	config="${KV_OUT_DIR}/.config"
 	[ ! -f "${config}" ] && config="/proc/config.gz"
 	RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
@@ -655,8 +652,7 @@
 	require_configured_kernel
 	get_version
 
-	if ! linux_chkconfig_builtin "MODULES"
-	then
+	if ! linux_chkconfig_builtin "MODULES"; then
 		eerror "These sources do not support loading external modules."
 		eerror "to be able to use this module please enable \"Loadable modules support\""
 		eerror "in your kernel, recompile and then try merging this module again."
@@ -669,20 +665,19 @@
 # It checks the kernel config options specified by CONFIG_CHECK. It dies only when a required config option (i.e.
 # the prefix ~ is not used) doesn't satisfy the directive.
 check_extra_config() {
-	local	config negate die error reworkmodulenames
-	local	soft_errors_count=0 hard_errors_count=0 config_required=0
+	local config negate die error reworkmodulenames
+	local soft_errors_count=0 hard_errors_count=0 config_required=0
 	# store the value of the QA check, because otherwise we won't catch usages
 	# after if check_extra_config is called AND other direct calls are done
 	# later.
-	local   old_LINUX_CONFIG_EXISTS_DONE="${_LINUX_CONFIG_EXISTS_DONE}"
+	local old_LINUX_CONFIG_EXISTS_DONE="${_LINUX_CONFIG_EXISTS_DONE}"
 
 	# if we haven't determined the version yet, we need to
 	linux-info_get_any_version
 
 	# Determine if we really need a .config. The only time when we don't need
 	# one is when all of the CONFIG_CHECK options are prefixed with "~".
-	for config in ${CONFIG_CHECK}
-	do
+	for config in ${CONFIG_CHECK}; do
 		if [[ "${config:0:1}" != "~" ]]; then
 			config_required=1
 			break





^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2013-01-24 20:47 Mike Frysinger (vapier)
  0 siblings, 0 replies; 46+ messages in thread
From: Mike Frysinger (vapier) @ 2013-01-24 20:47 UTC (permalink / raw
  To: gentoo-commits

vapier      13/01/24 20:47:23

  Modified:             linux-info.eclass
  Log:
  handle more kernel versions like 3.7-trunk-amd64 and add a testsuite for it

Revision  Changes    Path
1.96                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.96&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.96&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.95&r2=1.96

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- linux-info.eclass	16 Jan 2013 14:29:01 -0000	1.95
+++ linux-info.eclass	24 Jan 2013 20:47:23 -0000	1.96
@@ -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_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
 }





^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2013-02-10  2:21 Mike Frysinger (vapier)
  0 siblings, 0 replies; 46+ messages in thread
From: Mike Frysinger (vapier) @ 2013-02-10  2:21 UTC (permalink / raw
  To: gentoo-commits

vapier      13/02/10 02:21:55

  Modified:             linux-info.eclass
  Log:
  if KV_OUT_DIR is not set, do not let linux_config_src_exists implicitly check /.config #382787 by bay

Revision  Changes    Path
1.97                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.97&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.97&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.96&r2=1.97

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -r1.96 -r1.97
--- linux-info.eclass	24 Jan 2013 20:47:23 -0000	1.96
+++ linux-info.eclass	10 Feb 2013 02:21:55 -0000	1.97
@@ -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.96 2013/01/24 20:47:23 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.97 2013/02/10 02:21:55 vapier Exp $
 
 # @ECLASS: linux-info.eclass
 # @MAINTAINER:
@@ -245,7 +245,7 @@
 # It returns true if .config exists in a build directory otherwise false
 linux_config_src_exists() {
 	export _LINUX_CONFIG_EXISTS_DONE=1
-	[ -s "${KV_OUT_DIR}/.config" ]
+	[[ -n ${KV_OUT_DIR} && -s ${KV_OUT_DIR}/.config ]]
 }
 
 # @FUNCTION: linux_config_bin_exists
@@ -254,7 +254,7 @@
 # It returns true if .config exists in /proc, otherwise false
 linux_config_bin_exists() {
 	export _LINUX_CONFIG_EXISTS_DONE=1
-	[ -s "/proc/config.gz" ]
+	[[ -s /proc/config.gz ]]
 }
 
 # @FUNCTION: linux_config_exists
@@ -268,6 +268,20 @@
 	linux_config_src_exists || linux_config_bin_exists
 }
 
+# @FUNCTION: linux_config_path
+# @DESCRIPTION:
+# Echo the name of the config file to use.  If none are found,
+# then return false.
+linux_config_path() {
+	if linux_config_src_exists; then
+		echo "${KV_OUT_DIR}/.config"
+	elif linux_config_bin_exists; then
+		echo "/proc/config.gz"
+	else
+		return 1
+	fi
+}
+
 # @FUNCTION: require_configured_kernel
 # @DESCRIPTION:
 # This function verifies that the current kernel is configured (it checks against the existence of .config)
@@ -291,11 +305,7 @@
 # MUST call linux_config_exists first.
 linux_chkconfig_present() {
 	linux_config_qa_check linux_chkconfig_present
-	local RESULT config
-	config="${KV_OUT_DIR}/.config"
-	[ ! -f "${config}" ] && config="/proc/config.gz"
-	RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
-	[ "${RESULT}" = "m" -o "${RESULT}" = "y" ] && return 0 || return 1
+	[[ $(getfilevar_noexec "CONFIG_$1" "$(linux_config_path)") == [my] ]]
 }
 
 # @FUNCTION: linux_chkconfig_module
@@ -307,11 +317,7 @@
 # MUST call linux_config_exists first.
 linux_chkconfig_module() {
 	linux_config_qa_check linux_chkconfig_module
-	local RESULT config
-	config="${KV_OUT_DIR}/.config"
-	[ ! -f "${config}" ] && config="/proc/config.gz"
-	RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
-	[ "${RESULT}" = "m" ] && return 0 || return 1
+	[[ $(getfilevar_noexec "CONFIG_$1" "$(linux_config_path)") == m ]]
 }
 
 # @FUNCTION: linux_chkconfig_builtin
@@ -323,11 +329,7 @@
 # MUST call linux_config_exists first.
 linux_chkconfig_builtin() {
 	linux_config_qa_check linux_chkconfig_builtin
-	local RESULT config
-	config="${KV_OUT_DIR}/.config"
-	[ ! -f "${config}" ] && config="/proc/config.gz"
-	RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
-	[ "${RESULT}" = "y" ] && return 0 || return 1
+	[[ $(getfilevar_noexec "CONFIG_$1" "$(linux_config_path)") == y ]]
 }
 
 # @FUNCTION: linux_chkconfig_string
@@ -339,10 +341,7 @@
 # MUST call linux_config_exists first.
 linux_chkconfig_string() {
 	linux_config_qa_check linux_chkconfig_string
-	local config
-	config="${KV_OUT_DIR}/.config"
-	[ ! -f "${config}" ] && config="/proc/config.gz"
-	getfilevar_noexec "CONFIG_${1}" "${config}"
+	getfilevar_noexec "CONFIG_$1" "$(linux_config_path)"
 }
 
 # Versioning Functions





^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2013-02-10  6:18 Mike Frysinger (vapier)
  0 siblings, 0 replies; 46+ messages in thread
From: Mike Frysinger (vapier) @ 2013-02-10  6:18 UTC (permalink / raw
  To: gentoo-commits

vapier      13/02/10 06:18:19

  Modified:             linux-info.eclass
  Log:
  use emake rather than make to extract variable values #373151 by Kevin Pyle

Revision  Changes    Path
1.98                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.98&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.98&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.97&r2=1.98

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- linux-info.eclass	10 Feb 2013 02:21:55 -0000	1.97
+++ linux-info.eclass	10 Feb 2013 06:18:19 -0000	1.98
@@ -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.97 2013/02/10 02:21:55 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.98 2013/02/10 06:18:19 vapier Exp $
 
 # @ECLASS: linux-info.eclass
 # @MAINTAINER:
@@ -183,8 +183,10 @@
 		basedname="$(dirname ${2})"
 		unset ARCH
 
+		# We use nonfatal because we want the caller to take care of things #373151
+		[[ ${EAPI:-0} == [0123] ]] && nonfatal() { "$@"; }
 		echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
-			make -C "${basedname}" M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null
+			nonfatal emake -C "${basedname}" M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null
 
 		ARCH=${myARCH}
 	fi





^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2013-02-10  6:20 Mike Frysinger (vapier)
  0 siblings, 0 replies; 46+ messages in thread
From: Mike Frysinger (vapier) @ 2013-02-10  6:20 UTC (permalink / raw
  To: gentoo-commits

vapier      13/02/10 06:20:10

  Modified:             linux-info.eclass
  Log:
  delete empty depend vars

Revision  Changes    Path
1.99                 eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.99&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.99&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.98&r2=1.99

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -r1.98 -r1.99
--- linux-info.eclass	10 Feb 2013 06:18:19 -0000	1.98
+++ linux-info.eclass	10 Feb 2013 06:20:10 -0000	1.99
@@ -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.98 2013/02/10 06:18:19 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.99 2013/02/10 06:20:10 vapier Exp $
 
 # @ECLASS: linux-info.eclass
 # @MAINTAINER:
@@ -111,9 +111,6 @@
 
 EXPORT_FUNCTIONS pkg_setup
 
-DEPEND=""
-RDEPEND=""
-
 # Overwritable environment Var's
 # ---------------------------------------
 KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}"





^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2013-02-10  7:53 Mike Frysinger (vapier)
  0 siblings, 0 replies; 46+ messages in thread
From: Mike Frysinger (vapier) @ 2013-02-10  7:53 UTC (permalink / raw
  To: gentoo-commits

vapier      13/02/10 07:53:32

  Modified:             linux-info.eclass
  Log:
  if KERNEL_DIR is pointing to the object output, figure out the source dir and setup KBUILD_OUTPUT automatically #454294 by Łukasz Stelmach

Revision  Changes    Path
1.100                eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.100&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.100&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.99&r2=1.100

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- linux-info.eclass	10 Feb 2013 06:20:10 -0000	1.99
+++ linux-info.eclass	10 Feb 2013 07:53:31 -0000	1.100
@@ -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.99 2013/02/10 06:20:10 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.100 2013/02/10 07:53:31 vapier Exp $
 
 # @ECLASS: linux-info.eclass
 # @MAINTAINER:
@@ -462,6 +462,13 @@
 		return 1
 	fi
 
+	# See if the kernel dir is actually an output dir. #454294
+	if [ -z "${KBUILD_OUTPUT}" -a -L "${KERNEL_DIR}/source" ]; then
+		KBUILD_OUTPUT=${KERNEL_DIR}
+		KERNEL_DIR=$(readlink -f "${KERNEL_DIR}/source")
+		KV_DIR=${KERNEL_DIR}
+	fi
+
 	if [ -z "${get_version_warning_done}" ]; then
 		qeinfo "Found kernel source directory:"
 		qeinfo "    ${KV_DIR}"
@@ -481,7 +488,7 @@
 	# KBUILD_OUTPUT, and we need this for .config and localversions-*
 	# so we better find it eh?
 	# do we pass KBUILD_OUTPUT on the CLI?
-	OUTPUT_DIR="${OUTPUT_DIR:-${KBUILD_OUTPUT}}"
+	local OUTPUT_DIR=${KBUILD_OUTPUT}
 
 	# keep track of it
 	KERNEL_MAKEFILE="${KV_DIR}/Makefile"





^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2013-09-29  2:36 Mike Frysinger (vapier)
  0 siblings, 0 replies; 46+ messages in thread
From: Mike Frysinger (vapier) @ 2013-09-29  2:36 UTC (permalink / raw
  To: gentoo-commits

vapier      13/09/29 02:36:17

  Modified:             linux-info.eclass
  Log:
  get_version: do not parse KBUILD_OUTPUT in the cases where we do not use it as reported by Doug Anderson from ChromiumOS

Revision  Changes    Path
1.101                eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.101&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.101&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.100&r2=1.101

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- linux-info.eclass	10 Feb 2013 07:53:31 -0000	1.100
+++ linux-info.eclass	29 Sep 2013 02:36:17 -0000	1.101
@@ -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.100 2013/02/10 07:53:31 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.101 2013/09/29 02:36:17 vapier Exp $
 
 # @ECLASS: linux-info.eclass
 # @MAINTAINER:
@@ -429,7 +429,7 @@
 # KBUILD_OUTPUT (in a decreasing priority list, we look for the env var, makefile var or the
 # symlink /lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build).
 get_version() {
-	local kbuild_output mkfunc tmplocal
+	local mkfunc tmplocal
 
 	# no need to execute this twice assuming KV_FULL is populated.
 	# we can force by unsetting KV_FULL
@@ -497,8 +497,9 @@
 	mkfunc="$(get_makefile_extract_function "${KERNEL_MAKEFILE}")"
 
 	# And if we didn't pass it, we can take a nosey in the Makefile
-	kbuild_output="$(${mkfunc} KBUILD_OUTPUT ${KERNEL_MAKEFILE})"
-	OUTPUT_DIR="${OUTPUT_DIR:-${kbuild_output}}"
+	if [[ -z ${OUTPUT_DIR} ]]; then
+		OUTPUT_DIR=$(${mkfunc} KBUILD_OUTPUT "${KERNEL_MAKEFILE}")
+	fi
 
 	# And contrary to existing functions I feel we shouldn't trust the
 	# directory name to find version information as this seems insane.





^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2013-09-29  2:49 Mike Frysinger (vapier)
  0 siblings, 0 replies; 46+ messages in thread
From: Mike Frysinger (vapier) @ 2013-09-29  2:49 UTC (permalink / raw
  To: gentoo-commits

vapier      13/09/29 02:49:40

  Modified:             linux-info.eclass
  Log:
  get_version: extract version info with getfilevar_noexec as it should always work, and is much faster than evaluating with make; reported by Doug Anderson from ChromiumOS

Revision  Changes    Path
1.102                eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.102&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.102&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.101&r2=1.102

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- linux-info.eclass	29 Sep 2013 02:36:17 -0000	1.101
+++ linux-info.eclass	29 Sep 2013 02:49:40 -0000	1.102
@@ -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.101 2013/09/29 02:36:17 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.102 2013/09/29 02:49:40 vapier Exp $
 
 # @ECLASS: linux-info.eclass
 # @MAINTAINER:
@@ -429,7 +429,7 @@
 # KBUILD_OUTPUT (in a decreasing priority list, we look for the env var, makefile var or the
 # symlink /lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build).
 get_version() {
-	local mkfunc tmplocal
+	local tmplocal
 
 	# no need to execute this twice assuming KV_FULL is populated.
 	# we can force by unsetting KV_FULL
@@ -493,21 +493,24 @@
 	# keep track of it
 	KERNEL_MAKEFILE="${KV_DIR}/Makefile"
 
-	# Decide the function used to extract makefile variables.
-	mkfunc="$(get_makefile_extract_function "${KERNEL_MAKEFILE}")"
-
-	# And if we didn't pass it, we can take a nosey in the Makefile
 	if [[ -z ${OUTPUT_DIR} ]]; then
+		# Decide the function used to extract makefile variables.
+		local mkfunc=$(get_makefile_extract_function "${KERNEL_MAKEFILE}")
+
+		# And if we didn't pass it, we can take a nosey in the Makefile.
 		OUTPUT_DIR=$(${mkfunc} KBUILD_OUTPUT "${KERNEL_MAKEFILE}")
 	fi
 
 	# And contrary to existing functions I feel we shouldn't trust the
 	# directory name to find version information as this seems insane.
-	# so we parse ${KERNEL_MAKEFILE}
-	KV_MAJOR="$(${mkfunc} VERSION ${KERNEL_MAKEFILE})"
-	KV_MINOR="$(${mkfunc} PATCHLEVEL ${KERNEL_MAKEFILE})"
-	KV_PATCH="$(${mkfunc} SUBLEVEL ${KERNEL_MAKEFILE})"
-	KV_EXTRA="$(${mkfunc} EXTRAVERSION ${KERNEL_MAKEFILE})"
+	# So we parse ${KERNEL_MAKEFILE}.  We should be able to trust that
+	# the Makefile is simple enough to use the noexec extract function.
+	# This has been true for every release thus far, and it's faster
+	# than using make to evaluate the Makefile every time.
+	KV_MAJOR=$(getfilevar_noexec VERSION "${KERNEL_MAKEFILE}")
+	KV_MINOR=$(getfilevar_noexec PATCHLEVEL "${KERNEL_MAKEFILE}")
+	KV_PATCH=$(getfilevar_noexec SUBLEVEL "${KERNEL_MAKEFILE}")
+	KV_EXTRA=$(getfilevar_noexec EXTRAVERSION "${KERNEL_MAKEFILE}")
 
 	if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ]
 	then





^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2014-06-28  7:54 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 46+ messages in thread
From: Robin H. Johnson (robbat2) @ 2014-06-28  7:54 UTC (permalink / raw
  To: gentoo-commits

robbat2     14/06/28 07:54:27

  Modified:             linux-info.eclass
  Log:
  ChangeLog

Revision  Changes    Path
1.104                eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.104&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.104&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.103&r2=1.104

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.103
retrieving revision 1.104
diff -p -w -b -B -u -u -r1.103 -r1.104
--- linux-info.eclass	21 Mar 2014 22:03:00 -0000	1.103
+++ linux-info.eclass	28 Jun 2014 07:54:27 -0000	1.104
@@ -1,6 +1,6 @@
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.103 2014/03/21 22:03:00 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.104 2014/06/28 07:54:27 robbat2 Exp $
 
 # @ECLASS: linux-info.eclass
 # @MAINTAINER:
@@ -164,7 +164,7 @@ qeerror() { qout eerror "${@}" ; }
 # done by including the configfile, and printing the variable with Make.
 # It WILL break if your makefile has missing dependencies!
 getfilevar() {
-	local ERROR basefname basedname myARCH="${ARCH}"
+	local ERROR basefname basedname myARCH="${ARCH}" M="${S}"
 	ERROR=0
 
 	[ -z "${1}" ] && ERROR=1
@@ -182,8 +182,11 @@ getfilevar() {
 
 		# We use nonfatal because we want the caller to take care of things #373151
 		[[ ${EAPI:-0} == [0123] ]] && nonfatal() { "$@"; }
+		case ${EBUILD_PHASE_FUNC} in
+			pkg_info|pkg_nofetch|pkg_pretend) M="${T}" ;;
+		esac
 		echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
-			nonfatal emake -C "${basedname}" M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null
+			nonfatal emake -C "${basedname}" M="${M}" ${BUILD_FIXES} -s -f - 2>/dev/null
 
 		ARCH=${myARCH}
 	fi





^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2015-05-09  8:03 Ulrich Mueller (ulm)
  0 siblings, 0 replies; 46+ messages in thread
From: Ulrich Mueller (ulm) @ 2015-05-09  8:03 UTC (permalink / raw
  To: gentoo-commits

ulm         15/05/09 08:03:40

  Modified:             linux-info.eclass
  Log:
  Update a comment.

Revision  Changes    Path
1.105                eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.105&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.105&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.104&r2=1.105

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -r1.104 -r1.105
--- linux-info.eclass	28 Jun 2014 07:54:27 -0000	1.104
+++ linux-info.eclass	9 May 2015 08:03:40 -0000	1.105
@@ -1,6 +1,6 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.104 2014/06/28 07:54:27 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.105 2015/05/09 08:03:40 ulm Exp $
 
 # @ECLASS: linux-info.eclass
 # @MAINTAINER:
@@ -599,7 +599,7 @@
 		return $?
 	else
 		# 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.
+		# 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})





^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2015-06-02  4:27 Mike Frysinger (vapier)
  0 siblings, 0 replies; 46+ messages in thread
From: Mike Frysinger (vapier) @ 2015-06-02  4:27 UTC (permalink / raw
  To: gentoo-commits

vapier      15/06/02 04:27:35

  Modified:             linux-info.eclass
  Log:
  fix looking up output dir when cross-compiling (fix by Nam Nguyen from Chromium OS)

Revision  Changes    Path
1.106                eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.106&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.106&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.105&r2=1.106

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -r1.105 -r1.106
--- linux-info.eclass	9 May 2015 08:03:40 -0000	1.105
+++ linux-info.eclass	2 Jun 2015 04:27:35 -0000	1.106
@@ -1,6 +1,6 @@
 # Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.105 2015/05/09 08:03:40 ulm Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.106 2015/06/02 04:27:35 vapier Exp $
 
 # @ECLASS: linux-info.eclass
 # @MAINTAINER:
@@ -529,7 +529,15 @@
 	# but before we do this, we need to find if we use a different object directory.
 	# This *WILL* break if the user is using localversions, but we assume it was
 	# caught before this if they are.
-	OUTPUT_DIR="${OUTPUT_DIR:-/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build}"
+	if [[ -z ${OUTPUT_DIR} ]] ; then
+		# Try to locate a kernel that is most relevant for us.
+		for OUTPUT_DIR in "${SYROOT}" "${ROOT}" "" ; do
+			OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build"
+			if [[ -e ${OUTPUT_DIR} ]] ; then
+				break
+			fi
+		done
+	fi
 
 	[ -h "${OUTPUT_DIR}" ] && KV_OUT_DIR="$(readlink -f ${OUTPUT_DIR})"
 	[ -d "${OUTPUT_DIR}" ] && KV_OUT_DIR="${OUTPUT_DIR}"





^ permalink raw reply	[flat|nested] 46+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass
@ 2015-06-02  7:39 Mike Frysinger (vapier)
  0 siblings, 0 replies; 46+ messages in thread
From: Mike Frysinger (vapier) @ 2015-06-02  7:39 UTC (permalink / raw
  To: gentoo-commits

vapier      15/06/02 07:39:52

  Modified:             linux-info.eclass
  Log:
  fix typo in SYSROOT var pointed out by Michał Górny

Revision  Changes    Path
1.107                eclass/linux-info.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.107&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?rev=1.107&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?r1=1.106&r2=1.107

Index: linux-info.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -r1.106 -r1.107
--- linux-info.eclass	2 Jun 2015 04:27:35 -0000	1.106
+++ linux-info.eclass	2 Jun 2015 07:39:52 -0000	1.107
@@ -1,6 +1,6 @@
 # Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.106 2015/06/02 04:27:35 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.107 2015/06/02 07:39:52 vapier Exp $
 
 # @ECLASS: linux-info.eclass
 # @MAINTAINER:
@@ -531,7 +531,7 @@
 	# caught before this if they are.
 	if [[ -z ${OUTPUT_DIR} ]] ; then
 		# Try to locate a kernel that is most relevant for us.
-		for OUTPUT_DIR in "${SYROOT}" "${ROOT}" "" ; do
+		for OUTPUT_DIR in "${SYSROOT}" "${ROOT}" "" ; do
 			OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build"
 			if [[ -e ${OUTPUT_DIR} ]] ; then
 				break





^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2015-06-02  7:40 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-06 23:12 [gentoo-commits] gentoo-x86 commit in eclass: linux-info.eclass Robin H. Johnson (robbat2)
  -- strict thread matches above, loose matches on Subject: below --
2015-06-02  7:39 Mike Frysinger (vapier)
2015-06-02  4:27 Mike Frysinger (vapier)
2015-05-09  8:03 Ulrich Mueller (ulm)
2014-06-28  7:54 Robin H. Johnson (robbat2)
2013-09-29  2:49 Mike Frysinger (vapier)
2013-09-29  2:36 Mike Frysinger (vapier)
2013-02-10  7:53 Mike Frysinger (vapier)
2013-02-10  6:20 Mike Frysinger (vapier)
2013-02-10  6:18 Mike Frysinger (vapier)
2013-02-10  2:21 Mike Frysinger (vapier)
2013-01-24 20:47 Mike Frysinger (vapier)
2013-01-14 21:19 Mike Frysinger (vapier)
2011-03-29 19:57 Diego Petteno (flameeyes)
2011-01-04 17:53 Doug Goldstein (cardoe)
2010-08-05 21:57 Robin H. Johnson (robbat2)
2010-08-03  7:03 Robin H. Johnson (robbat2)
2010-06-17 23:46 Jonathan Callen (abcd)
2010-01-17 21:46 Robin H. Johnson (robbat2)
2010-01-17 21:34 Robin H. Johnson (robbat2)
2010-01-10  9:26 Robin H. Johnson (robbat2)
2010-01-10  9:25 Robin H. Johnson (robbat2)
2010-01-10  9:01 Robin H. Johnson (robbat2)
2010-01-10  8:47 Robin H. Johnson (robbat2)
2010-01-10  8:25 Robin H. Johnson (robbat2)
2009-12-11 21:33 Robin H. Johnson (robbat2)
2009-12-11 20:54 Robin H. Johnson (robbat2)
2009-12-11 20:42 Robin H. Johnson (robbat2)
2009-10-11 11:48 Markus Meier (maekke)
2009-09-13 20:44 Robin H. Johnson (robbat2)
2009-09-08 12:34 Robin H. Johnson (robbat2)
2009-09-06 23:41 Robin H. Johnson (robbat2)
2009-09-06 23:40 Robin H. Johnson (robbat2)
2009-09-06 23:36 Robin H. Johnson (robbat2)
2009-09-06 23:31 Robin H. Johnson (robbat2)
2009-09-06 23:24 Robin H. Johnson (robbat2)
2009-09-06 23:04 Robin H. Johnson (robbat2)
2009-09-06 22:54 Robin H. Johnson (robbat2)
2009-08-30 22:37 Robin H. Johnson (robbat2)
2009-07-04 18:39 Robin H. Johnson (robbat2)
2009-03-27 20:13 Peter Alfredsen (loki_val)
2009-01-12 23:04 Markus Meier (maekke)
2008-12-03 18:11 Daniel Drake (dsd)
2008-10-31 22:01 Daniel Drake (dsd)
2008-03-21 11:11 Daniel Drake (dsd)
2008-01-23 20:58 Daniel Drake (dsd)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox