www-client/google-chrome-beta: automated update (84.0.4147.30)
[gentoo.git] / eclass / linux-info.eclass
index b158e345d16668d70a213026dbeb61fe60d53224..405ef5571e1c917b0927b8050be0d4b303296588 100644 (file)
@@ -159,7 +159,7 @@ qeerror() { qout eerror "${@}" ; }
 # ---------------------------------------
 
 # @FUNCTION: getfilevar
-# @USAGE: variable configfile
+# @USAGE: <variable> <configfile>
 # @RETURN: the value of the variable
 # @DESCRIPTION:
 # It detects the value of the variable defined in the file configfile. This is
@@ -195,7 +195,7 @@ getfilevar() {
 }
 
 # @FUNCTION: getfilevar_noexec
-# @USAGE: variable configfile
+# @USAGE: <variable> <configfile>
 # @RETURN: the value of the variable
 # @DESCRIPTION:
 # It detects the value of the variable defined in the file configfile.
@@ -310,7 +310,7 @@ require_configured_kernel() {
 }
 
 # @FUNCTION: linux_chkconfig_present
-# @USAGE: option
+# @USAGE: <option>
 # @RETURN: true or false
 # @DESCRIPTION:
 # It checks that CONFIG_<option>=y or CONFIG_<option>=m is present in the current kernel .config
@@ -322,7 +322,7 @@ linux_chkconfig_present() {
 }
 
 # @FUNCTION: linux_chkconfig_module
-# @USAGE: option
+# @USAGE: <option>
 # @RETURN: true or false
 # @DESCRIPTION:
 # It checks that CONFIG_<option>=m is present in the current kernel .config
@@ -334,7 +334,7 @@ linux_chkconfig_module() {
 }
 
 # @FUNCTION: linux_chkconfig_builtin
-# @USAGE: option
+# @USAGE: <option>
 # @RETURN: true or false
 # @DESCRIPTION:
 # It checks that CONFIG_<option>=y is present in the current kernel .config
@@ -346,7 +346,7 @@ linux_chkconfig_builtin() {
 }
 
 # @FUNCTION: linux_chkconfig_string
-# @USAGE: option
+# @USAGE: <option>
 # @RETURN: CONFIG_<option>
 # @DESCRIPTION:
 # It prints the CONFIG_<option> value of the current kernel .config (it requires a configured kernel).
@@ -361,7 +361,7 @@ linux_chkconfig_string() {
 # ---------------------------------------
 
 # @FUNCTION: kernel_is
-# @USAGE: [-lt -gt -le -ge -eq] major_number [minor_number patch_number]
+# @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.
@@ -548,13 +548,22 @@ get_version() {
                return 1
        fi
 
+       [ -d "${OUTPUT_DIR}" ] && KV_OUT_DIR="${OUTPUT_DIR}"
+       if [ -n "${KV_OUT_DIR}" ];
+       then
+               qeinfo "Found kernel object directory:"
+               qeinfo "    ${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}}"
+
        # 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_DIR}"/include/config/kernel.release ]; then
-               KV_LOCAL=$(<"${KV_DIR}"/include/config/kernel.release)
-       elif [ -s "${KV_DIR}"/.kernelrelease ]; then
-               KV_LOCAL=$(<"${KV_DIR}"/.kernelrelease)
+       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
                KV_LOCAL=
        fi
@@ -586,15 +595,6 @@ get_version() {
                done
        fi
 
-       [ -d "${OUTPUT_DIR}" ] && KV_OUT_DIR="${OUTPUT_DIR}"
-       if [ -n "${KV_OUT_DIR}" ];
-       then
-               qeinfo "Found kernel object directory:"
-               qeinfo "    ${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}}"
-
        # And we should set KV_FULL to the full expanded version
        KV_FULL="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}"
 
@@ -813,7 +813,7 @@ check_extra_config() {
                        linux_chkconfig_present ${config} || error=1
                fi
 
-               if [[ ${error} > 0 ]]; then
+               if [[ ${error} -gt 0 ]]; then
                        local report_func="eerror" local_error
                        local_error="ERROR_${config}"
                        local_error="${!local_error}"
@@ -848,14 +848,14 @@ check_extra_config() {
                fi
        done
 
-       if [[ ${hard_errors_count} > 0 ]]; then
+       if [[ ${hard_errors_count} -gt 0 ]]; then
                eerror "Please check to make sure these options are set correctly."
                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
+       elif [[ ${soft_errors_count} -gt 0 ]]; then
                ewarn "Please check to make sure these options are set correctly."
                ewarn "Failure to do so may cause unexpected problems."
        else