8238204: run_tests.sh fails on macOS when called from test_jpackage.sh

Reviewed-by: herrick, almatvee
This commit is contained in:
Alexey Semenyuk 2020-06-08 09:13:01 -04:00
parent 28d2cdf99a
commit f87ef60b09
2 changed files with 7 additions and 7 deletions

View File

@ -248,18 +248,18 @@ installJtreg ()
preRun ()
{
local xargs_args=(-t --no-run-if-empty rm)
if [ -n "$dry_run" ]; then
xargs_args=(--no-run-if-empty echo rm)
fi
if [ ! -d "$output_dir" ]; then
exec_command mkdir -p "$output_dir"
fi
[ ! -d "$output_dir" ] || output_dir=$(cd "$output_dir" && pwd)
# Clean output directory
[ "$mode" != "create" ] || find $output_dir -maxdepth 1 -type f -name '*.exe' -or -name '*.msi' -or -name '*.rpm' -or -name '*.deb' | xargs "${xargs_args[@]}"
if [ "$mode" == "create" ]; then
for f in $(find $output_dir -maxdepth 1 -type f -name '*.exe' -or -name '*.msi' -or -name '*.rpm' -or -name '*.deb'); do
echo rm "$f"
[ -n "$dry_run" ] || rm "$f"
done
fi
}

View File

@ -75,4 +75,4 @@ exec_command ()
set_args "$@"
basedir="$(dirname $0)"
exec_command "$basedir/run_tests.sh" -m create "${args[@]}"
exec_command ${SHELL} "$basedir/run_tests.sh" -m create "${args[@]}"