[m-dev.] dos2unix

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Nov 23 02:40:36 AEDT 2002


On 22-Nov-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> On Thu, Nov 21, 2002 at 12:12:01AM +1100, Fergus Henderson wrote:
> > I would be happy to see a change which (1) automatically detected whether
> > the tests were being run on a file system mounted in text-mode
> > (e.g. by examining one of the .exp files to see if it contains "\r"),
> > and (2) somehow figures out whether the output of the programs is supposed
> > to be in Unix or DOS format (I guess as a first approximation you could
> > check whether the output of a simple program *is* in Unix or DOS format)
> > and then (3) pipes the .exp files through unix2dos or dos2unix
> > as appropriate.  Such a change would make it easier to run the tests,
> > since you wouldn't need to worry about whether the tests were checked
> > out (or untarred, etc.) in the appropriate format.  (But it's just
> > an ease-of-development issue, not even an ease-of-use issue,
> > so it's certainly not release-critical ;-)
>
> What about this change, which allows the user to override the default
> behaviour when needed.

That approach would be OK, but the file which is optionally piped through
a conversion program should be the `.exp' file, not the `.out' file,
because piping the `.out' file through a conversion program such as
`dos2unix' can hide errors.

(In theory piping `.exp' files through a conversion program could also
hide errors, but that is not a problem because this would only happen
if the `.exp' files contained odd line endings, which they don't.)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list