Bernhard Voelker wrote: > As a replacement for my previously proposed patch: > "[PATCH] tests: adjust PATH to include /usr/sbin for filefrag-using tests" > (see http://lists.gnu.org/archive/html/coreutils/2011-11/msg00086.html), > and after some confusion in the discussion, the following patch adds > /sbin and /usr/sbin generally for all tests. ... > diff --git a/tests/init.cfg b/tests/init.cfg ... > - PATH="$PATH:/sbin" > - export PATH > -} > - > get_process_status_() > { > sed -n '/^State:[ ]*\([[:alpha:]]\).*/s//\1/p' /proc/$1/status
Your patch was fine, but your mail client mangled the sole TAB, rendering it inapplicable via "git am FILE". The very last line of diff context in the init.cfg diff should have had a TAB in the brackets after State:, but instead had a few extra spaces. $ g am -3 j Applying: tests: adjust PATH to generally include /sbin and /usr/sbin Using index info to reconstruct a base tree... error: patch failed: tests/init.cfg:195 error: tests/init.cfg: patch does not apply Did you hand edit your patch? It does not apply to blobs recorded in its index. Cannot fall back to three-way merge. Patch failed at 0001 tests: adjust PATH to generally include /sbin and /usr/sbin When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort". Applying with git am --ignore-space-change FILE worked around that. Also, I adjusted this comment to say precisely what we do in that case: # Having an unsearchable directory in PATH causes execve to fail with EACCES # when applied to an unresolvable program name, contrary to the desired ENOENT. # Avoid the problem by rewriting PATH to exclude unsearchable directories. -# Additionally assure that /sbin and /usr/sbin are included in PATH. +# Also, if PATH lacks /sbin and/or /usr/sbin, append it/them. sanitize_path_()
