This avoids globbing, see: https://www.shellcheck.net/wiki/SC2223

Signed-off-by: Ulrich Müller <u...@gentoo.org>
---
 eclass/cmake.eclass | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index 03f2517c5b56..30de3c71faa4 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -35,15 +35,15 @@ inherit flag-o-matic multiprocessing ninja-utils 
toolchain-funcs xdg-utils
 # For in-source build it's fixed to ${CMAKE_USE_DIR}.
 # For out-of-source build it can be overridden, by default it uses
 # ${CMAKE_USE_DIR}_build (in EAPI-7: ${WORKDIR}/${P}_build).
-[[ ${EAPI} == 7 ]] && : ${BUILD_DIR:=${WORKDIR}/${P}_build}
+[[ ${EAPI} == 7 ]] && : "${BUILD_DIR:=${WORKDIR}/${P}_build}"
 # EAPI-8: set inside _cmake_check_build_dir
 
 # @ECLASS_VARIABLE: CMAKE_BINARY
 # @DESCRIPTION:
 # Eclass can use different cmake binary than the one provided in by system.
-: ${CMAKE_BINARY:=cmake}
+: "${CMAKE_BINARY:=cmake}"
 
-[[ ${EAPI} == 7 ]] && : ${CMAKE_BUILD_TYPE:=Gentoo}
+[[ ${EAPI} == 7 ]] && : "${CMAKE_BUILD_TYPE:=Gentoo}"
 # @ECLASS_VARIABLE: CMAKE_BUILD_TYPE
 # @DESCRIPTION:
 # Set to override default CMAKE_BUILD_TYPE. Only useful for packages
@@ -55,7 +55,7 @@ inherit flag-o-matic multiprocessing ninja-utils 
toolchain-funcs xdg-utils
 # build type to achieve desirable results.
 #
 # In EAPI 7, the default was non-standard build type of Gentoo.
-: ${CMAKE_BUILD_TYPE:=RelWithDebInfo}
+: "${CMAKE_BUILD_TYPE:=RelWithDebInfo}"
 
 # @ECLASS_VARIABLE: CMAKE_IN_SOURCE_BUILD
 # @DEFAULT_UNSET
@@ -69,7 +69,7 @@ inherit flag-o-matic multiprocessing ninja-utils 
toolchain-funcs xdg-utils
 # Specify a makefile generator to be used by cmake.
 # At this point only "emake" and "ninja" are supported.
 # The default is set to "ninja".
-: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+: "${CMAKE_MAKEFILE_GENERATOR:=ninja}"
 
 # @ECLASS_VARIABLE: CMAKE_REMOVE_MODULES_LIST
 # @PRE_INHERIT
@@ -100,14 +100,14 @@ fi
 # @USER_VARIABLE
 # @DESCRIPTION:
 # Set to OFF to disable verbose messages during compilation
-: ${CMAKE_VERBOSE:=ON}
+: "${CMAKE_VERBOSE:=ON}"
 
 # @ECLASS_VARIABLE: CMAKE_WARN_UNUSED_CLI
 # @DESCRIPTION:
 # Warn about variables that are declared on the command line
 # but not used. Might give false-positives.
 # "no" to disable (default) or anything else to enable.
-: ${CMAKE_WARN_UNUSED_CLI:=yes}
+: "${CMAKE_WARN_UNUSED_CLI:=yes}"
 
 # @ECLASS_VARIABLE: CMAKE_EXTRA_CACHE_FILE
 # @USER_VARIABLE
@@ -284,15 +284,15 @@ cmake-utils_useno() { _cmake_banned_func "" "$@" ; }
 # Determine using IN or OUT source build
 _cmake_check_build_dir() {
        if [[ ${EAPI} == 7 ]]; then
-               : ${CMAKE_USE_DIR:=${S}}
+               : "${CMAKE_USE_DIR:=${S}}"
        else
-               : ${CMAKE_USE_DIR:=${PWD}}
+               : "${CMAKE_USE_DIR:=${PWD}}"
        fi
        if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then
                # we build in source dir
                BUILD_DIR="${CMAKE_USE_DIR}"
        else
-               : ${BUILD_DIR:=${CMAKE_USE_DIR}_build}
+               : "${BUILD_DIR:=${CMAKE_USE_DIR}_build}"
        fi
 
        einfo "Source directory (CMAKE_USE_DIR): \"${CMAKE_USE_DIR}\""
-- 
2.40.0


Reply via email to