diff options
author | Kerin Millar <kfm@plushkava.net> | 2024-08-08 10:28:03 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-08-11 11:11:00 +0100 |
commit | 2f32e4a026a1d45bfc8223f55bb8913f2d455ec5 (patch) | |
tree | 84b2cf68e8f272afbda229046c605616f65c0af9 | |
parent | Implement a variant of quote_args() optimised for bash (diff) | |
download | gentoo-functions-2f32e4a026a1d45bfc8223f55bb8913f2d455ec5.tar.gz gentoo-functions-2f32e4a026a1d45bfc8223f55bb8913f2d455ec5.tar.bz2 gentoo-functions-2f32e4a026a1d45bfc8223f55bb8913f2d455ec5.zip |
test-functions: choose a better variable name for storing the temp dir
The name, dir, is rather generic. Rename it to global_tmpdir to diminish
the likelihood of an accidental name space conflict.
Also, don't pass the -f option to rm(1) at the point that the directory
is to be removed.
Signed-off-by: Kerin Millar <kfm@plushkava.net>
Signed-off-by: Sam James <sam@gentoo.org>
-rwxr-xr-x | test-functions | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test-functions b/test-functions index 275d32f..1f54208 100755 --- a/test-functions +++ b/test-functions @@ -12,14 +12,14 @@ bailout() { } assign_tmpdir() { - dir=$(mktemp -d) \ - && chdir "${dir}" \ + global_tmpdir=$(mktemp -d) \ + && chdir "${global_tmpdir}" \ || bailout "Couldn't create or change to the temp dir" } cleanup_tmpdir() { - if [ -n "${dir}" ]; then - rm -rf -- "${dir}" + if [ "${global_tmpdir}" ]; then + rm -r -- "${global_tmpdir}" fi } @@ -1103,7 +1103,7 @@ iterate_tests() { printf 'TAP version 13\n' -unset -v dir +unset -v global_tmpdir # PATH is redefined to prevent ebuild-helpers such as die from interfering. export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/pkg/bin |