From 516e3ae7d6b661e8ac7ed59a9e9d62898536724f Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 31 Mar 2015 13:24:29 +0200 Subject: [PATCH] Use find instead of ls The listing of *-$INSTALL_TYPE-install files currently uses ls, which errors out when the glob matches no files, thus using true to not fail it. Instead, use find to collect the file list, so there is no need to ignore the command errors. Change-Id: Ic6888106858df320a1c90a84f1b9ec74d436b9e6 --- elements/base/extra-data.d/99-enable-install-types | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elements/base/extra-data.d/99-enable-install-types b/elements/base/extra-data.d/99-enable-install-types index 143426ae..bf52fd04 100755 --- a/elements/base/extra-data.d/99-enable-install-types +++ b/elements/base/extra-data.d/99-enable-install-types @@ -50,7 +50,7 @@ done # For any existing *--install directory under install.d, # if an environment variable setting a different install type was not seen, # enable the default (set via --install-type). -default_install_type_dirs=$(ls -d $TMP_HOOKS_PATH/install.d/*-${DIB_DEFAULT_INSTALLTYPE}-install || true) +default_install_type_dirs=$(find $TMP_HOOKS_PATH/install.d -maxdepth 1 -name "*-${DIB_DEFAULT_INSTALLTYPE}-install" -type d) for _install_dir in $default_install_type_dirs; do SUFFIX="-${DIB_DEFAULT_INSTALLTYPE}-install" _install_dir=$(basename $_install_dir)