Hi Pádraig,

Pádraig Brady <[email protected]> writes:

> I'd prefer not to introduce more $abs_top_builddir references if
> possible.
> How about we just warn about and avoid found coreutils dispatchers?
> I also noticed other questionable uses of $abs_top_builddir in tests/
> which I've also cleaned up in the attached.

Yes, I wasn't a huge fan of my fix either. Your change looks good to me,
and adding the functions to init.cfg is a nice cleanup in general.

I also noticed one use of $abs_path_dir_ in the tests, which
tests/init.sh sets. However, I assumed you'd like to use the cmd_exe
function there as well, even if only for consistency's sake.

Feel free to add this diff to your commit, if so:

diff --git a/tests/cp/preserve-gid.sh b/tests/cp/preserve-gid.sh
index d3e368d35..92bced414 100755
--- a/tests/cp/preserve-gid.sh
+++ b/tests/cp/preserve-gid.sh
@@ -110,13 +110,19 @@ cleanup_() { rm -rf "$tmp_path"; }
 # is not readable by our nameless IDs.
 test -d /tmp && TMPDIR=/tmp
 tmp_path=$(mktemp -d) || fail_ "failed to create temporary directory"
-if test -x "$abs_path_dir_/coreutils" &&
-   { test -L "$abs_path_dir_/cp" ||
-     test $(wc -l < "$abs_path_dir_/cp") = 1; } then
+single_binary=$(cmd_exe coreutils)
+if test -n "$single_binary" && ! single_binary_build_; then
+  warn_ "Warning: ignoring single binary dispatcher: $single_binary"
+  single_binary=
+fi
+abs_cp=$(cmd_exe cp)
+if test -n "$single_binary" &&
+   { test -L "$abs_cp" ||
+     test $(wc -l < "$abs_cp") = 1; } then
   # if configured with --enable-single-binary we need to use the single binary
-  cp "$abs_path_dir_/coreutils" "$tmp_path/cp" || framework_failure_
+  cp "$single_binary" "$tmp_path/cp" || framework_failure_
 else
-  cp "$abs_path_dir_/cp" "$tmp_path"
+  cp "$abs_cp" "$tmp_path"
 fi
 chmod -R a+rx "$tmp_path"
 

Collin

Reply via email to