On Tue, Nov 11, 2008 at 11:00:11AM +0000, Eric Kow wrote:
> On Tue, Nov 11, 2008 at 13:54:52 +1100, Trent W. Buck wrote:
> > These are the kinds of issues that make me wonder if zooko's idea of
> > writing all the tests in Haskell would be less hassle -- theoretically
> > then the test code would either be correct on all systems, or none.
> 
> I still like David's idea of holding out for a portable shell
> implementation that can run our tests, like Stephen Hick's shsh
>    http://code.haskell.org/shsh

sh is not the problem, because we already require bash.

The problem is that shell *utilities* (like grep and find) do not
behave consistently, even if we restrict ourselves to POSIX features
and nominally POSIX-compliant systems!  (Cf. /usr/bin/grep -F on Solaris).

> The idea is that we could implement our own cheap and cheerful
> GNU-ish grep, sed, etc (like the current hspwd).

Well if we're going to do that, we might as well just include a
convenience copy of the GNU coreutils distribution, instead of
re-writing them in Haskell.

> Would this be an acceptable solution?

I think that no matter what we do, we're screwed.  I blame
heterogeneity, and users who stubbornly refuse to upgrade from systems
like Solaris (with known bugs) to Linux (with unknown bugs) :-)

> Barring that, we could write a wiki page summing up our knowledge on
> how to write portable shell tests.

That's a good idea regardless.

In the same way that Debian has a "checkbashisms" script to identify
common uses of bashisms in #!/bin/sh scripts, perhaps we could write a
script (that need not itself be portable) that can catch people when
they introduce gotchas that have caught us before?

Simple examples would be checking lines for "yes.*|" and "grep.*-F".
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to