Solaris tools sadness

Danek Duvall danek.duvall at oracle.com
Mon Nov 9 17:31:09 CST 2015


Siddharth Agarwal wrote:

> On 11/9/15 14:18, Danek Duvall wrote:
>
> >What I've come up with to handle both bugs and that works with both Solaris
> >and GNU utilities is (brace for it)
> >
> >     (cut -b 1-6 ../b$t | tr -d '\0' | head -n 1; echo) | tr -s '\n'
> >
> >Delete all the nulls, force an extra newline, then remove all duplicate
> >newlines.
> >
> >If I sent this as a patch, would you laugh, or might it be accepted?  If
> >it's just too funny, I can patch locally and go on my way.
> 
> What about tiny inline Python scripts that just verify the output?

Right; that had occurred to me, too, but then I wasn't certain what to use
in order to get safe byte-oriented IO, so I went on to look at more shell
utilities.  dd was also a possibility, but that seemed less likely to be
present on Windows.  And I'm always reluctant (rationally or not) to
propose making mercurial bend over backwards for a Solaris-ism.

For the Python solution, would something like

    print open(path, "rb").read()[:6]

be okay?

Thanks,
Danek


More information about the Mercurial-devel mailing list