From: Heiko Schlittermann (HS12) Date: Tue, 7 Apr 2015 19:44:00 +0000 (+0200) Subject: Testsuite: Auto-detect missing sbin directories X-Git-Tag: exim-4_86_RC1~65 X-Git-Url: https://vcs.fsf.org/?p=exim.git;a=commitdiff_plain;h=26ab1da32241a0be1cf08ce866b00429fc35d06d 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. --- 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 #