linux-info.eclass: Skip linux_config_*_exists on non-Linux
authorMichał Górny <mgorny@gentoo.org>
Thu, 8 Mar 2018 16:26:09 +0000 (17:26 +0100)
committerMichał Górny <mgorny@gentoo.org>
Mon, 9 Jul 2018 16:54:47 +0000 (18:54 +0200)
The linux_config_src_exists and linux_config_bin_exists always return
false on non-Linux systems by design. Short-circuit it via
'kernel_linux' check.

eclass/linux-info.eclass

index 2ddc9e03e8908cf5512d27050af4cb0d14eb4b60..77df7a6ad609ddb25dd939f77a1f0d0e2201a3e4 100644 (file)
@@ -252,7 +252,7 @@ linux_config_qa_check() {
 # It returns true if .config exists in a build directory otherwise false
 linux_config_src_exists() {
        export _LINUX_CONFIG_EXISTS_DONE=1
-       [[ -n ${KV_OUT_DIR} && -s ${KV_OUT_DIR}/.config ]]
+       use kernel_linux && [[ -n ${KV_OUT_DIR} && -s ${KV_OUT_DIR}/.config ]]
 }
 
 # @FUNCTION: linux_config_bin_exists
@@ -261,7 +261,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
-       [[ -s /proc/config.gz ]]
+       use kernel_linux && [[ -s /proc/config.gz ]]
 }
 
 # @FUNCTION: linux_config_exists