Date: Mon, 5 Mar 2001 09:33:56 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Richard Dawe cc: DJGPP workers , Jim Meyering Subject: Re: Fetish.pm band-aid (Fileutils testsuite) In-Reply-To: <3AA29CC8.F86326A5@phekda.freeserve.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 4 Mar 2001, Richard Dawe wrote: > 1. _shell_quote() generates file names enclosed in single quotes. The > input file names are quoted using _shell_quote(). The Perl system() call > to generate test input then fails with the error "Cannot redirect input: > No such file or directory (ENOENT)". Presumably because this is because > the file name gets passed on the command-line with single quotes, but the > actual file has a file name with no quotes. I doubt that your guess is correct (modulo unknown bugs in the library). Assuming that Perl calls `system' from libc, it should handle quoted files just fine. This feature was heavily tested when it was introduced (circa v2.01), and is working with no known problems ever since. > 2. There seems to be a problem using '2> /dev/null' with the Perl system() > call. Do all the commands which fail redirect stderr with the "2>" construct? You seem to indicate that there are several failures, but only show one example, and all your patches to Fetish.pm seem to be related to stderr redirection. > "Ambiguous redirect" errors are generated. Both these messages ("Cannot redirect" and "Ambiguous redirect") are from `system's code. Significantly, they both indicate that `system' is using its internal emulator of COMMAND.COM, which doesn't support "2>" style redirection. In other words, the test suite setup is not taking care of setting $SHELL to point to the Bash executable. It should do that because these commands will never work with anything but a Unixy shell. When `system' sees that $SHELL points to a Unixy shell, it passes the entire command to the shell instead of handling it on its own. (This is explained in the `system's docs in the library reference.) It is quite common for Unix-born test suites to not bother setting $SHELL, since the default shell is good enough. But for this to work on non-Posix platforms, $SHELL _must_ be set. > How I encountered the problems with Fetish.pm. I am using DJGPP 2.03, bash > 2.04, Perl 5.005_02. I tried to use the 'dd' testsuite from Fileutils > 4.0.40 to test 'dd' from the Fileutils 4.0 DJGPP port I'm working on. With > a similar patch (exactly same changes, but Fetish.pm is newer in 4.0.40) > the ported 'dd' passes 'misc', 'skip-seek' and 'skip-seek2'. It fails > 'not-rewound' - I think because of redirection issues in the script. If the failures with `dd' are not explained by stderr redirection, please post the test source and results (diffs of actual against expected output). It is impossible to reason about this without knowing what does that test try to do.