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
This commit is contained in:
Pino Toscano 2015-03-31 13:24:29 +02:00
parent 4fbad49972
commit 516e3ae7d6

View File

@ -50,7 +50,7 @@ done
# For any existing *-<default_install_dir>-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)