From 26ab1da32241a0be1cf08ce866b00429fc35d06d Mon Sep 17 00:00:00 2001 From: "Heiko Schlittermann (HS12)" Date: Tue, 7 Apr 2015 21:44:00 +0200 Subject: [PATCH] Testsuite: Auto-detect missing sbin directories The runtest script maps bin directories to matching sbin directories, if they are not already included in the $PATH. This is mainly a comfort feature to find ifconfig on some systems automatically. --- test/runtest | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/runtest b/test/runtest index 6c98a702c..0a2ede9ef 100755 --- a/test/runtest +++ b/test/runtest @@ -2207,6 +2207,15 @@ return $yield; # Ran command and waited autoflush STDOUT 1; print "Exim tester $testversion\n"; +# extend the PATH with .../sbin +# we map all (.../bin) to (.../sbin:.../bin) +$ENV{PATH} = do { + my %seen = map { $_, 1 } split /:/, $ENV{PATH}; + join ':' => map { m{(.*)/bin$} + ? ( $seen{"$1/sbin"} ? () : ("$1/sbin"), $_) + : ($_) } + split /:/, $ENV{PATH}; +}; ################################################## # Some tests check created file modes # -- 2.25.1