On Saturday 18 June 2011, Stefano Lattarini wrote: > On Saturday 18 June 2011, Jim Meyering wrote: > > Stefano Lattarini wrote: > > >> ... > > >> > > > >> > In order to work with the upcoming new Automake testsuite harness, coreutils > > >> > have two possibilities: > > >> > 1. move the `shell_or_perl_' subroutine's functionality into a real acript, > > >> > and define the LOG_COMPILER to point to it; or > > >> > 2. add a `.pl' extension to the perl test scripts, and define PL_LOG_COMPILER > > >> > appropriately (might be a little tricky, considering the hops that the > > >> > `shell_or_perl_' subroutine goes through in order to get the flags and > > >> > imports right). > > >> > > >> 1) sounds preferable. > > >> > > > But it has a serious drawback: the redirection `9>&2' placed at the end > > > of TESTS_ENVIRONMENT will be rendered useless by the final exec done > > > in the new `shell_or_perl' script (at least for with shells using the > > > `cloexec' flag on fds > 2); this will bring back the problems fixed by > > > commit `v8.12-82-g6b68745' :-( > > > > Well, no, that's not true; the "problematic" shells only set the 'close-on-exec' > flag on the file descriptors they themselves create, not on the ones they inherit > from their parents: > > $ ksh -c 'exec 9>&1; sh -c "echo foo >&9"' > sh: 9: Bad file descriptor > $ ksh -c 'sh -c "echo foo >&9"' 9>&1 > foo > $ (exec 9>&1; ksh -c 'sh -c "echo foo >&9"') > foo > > I should have tested better before reporting an imaginary problem. > > > > So I now think we should go with solution (2). > > > > Ok. > > > I've gone with the less invasive solution (1) instead. See the attached > patch. I will soon post a follow up that tries to compensate for the > extra forks I've introduced here by removing a couple of grep calls from > the `shell-or-perl' script > Here it is. Regards, Stefano