[72118] trunk/dports/devel/gettext-lint

Ryan Schmidt ryandesign at macports.org
Mon Oct 4 01:09:57 PDT 2010


On Oct 4, 2010, at 02:40, Anders F Björklund wrote:

> Ryan Schmidt:
> 
>> You don't need dos2unix or any other additional program to translate DOS to UNIX line endings; just use a reinplace. I do this in many ports already.
>> 
>> post-patch {
>> 	reinplace "s|\r||g" ${worksrcpath}/src/POFileClean.in
>> }
> 
> And that regex is somehow easier to read ? ;-)

It's not too hard to read.... it removes all "\r".

Still, I usually prepend such a reinplace with a comment saying I'm converting the line endings. Usually I'm doing it in pre-patch, so that a patch with UNIX line endings can be applied cleanly to a source file with DOS line endings. See for example the alienarena port where I DOS-to-UNIX the whole source directory.

http://trac.macports.org/browser/trunk/dports/games/alienarena/Portfile?rev=71326#L65


> Maybe base should grow a native "dos2unix"...
> 
> Then you wouldn't need to copy the junk, but:
> 
> dos2unix -k ${worksrcpath}/src/POFileClean.in

-k?

It shouldn't be too bad to put the above reinplace into PortfileRecipes, however. I don't think we need a new MacPorts base function for something that can already be accomplished quite simply using reinplace.




More information about the macports-dev mailing list