USE_DOS2UNIX may be more powerful?

Frank Laszlo laszlof at vonostingroup.com
Tue Feb 7 05:51:29 PST 2006


Dmitry Marakasov wrote:
> Hi!
>
> I've just updated games/xmoto port I maintain, and I used newly introduced
> USE_DOS2UNIX variable instead of construction like that:
>
> @${FIND} ${WRKSRC}/src -name "*.cpp" -o -name "*.h" | \
> 	${XARGS} ${REINPLACE_CMD} -e "s|$$(${PRINTF} '\r')||g"
>
> I like the idea, but I think USE_DOS2UNIX should be a bit more powerful.
>
> Let us have a port having many subdirectories with *.cpp and *.h files,
> which all need to be dos2unix'ed. Also, there are binary files.  Thus, we
> can't use USE_DOS2UNIX=yes as it will corrupt binaries, and we should
> specify many paths to files we want to process. For xmoto, to process all
> source and header files, I'll need to do this:
>
> USE_DOS2UNIX= src/*.cpp src/*.h src/image/*.cpp src/image/*.h \ 
> 		src/tinyxml/*.cpp src/tinyxml/*.h
>
> these are only 3 dirs, I've seen much more.
>
> So what do you think of idea of making USE_DOS2UNIX more like interface to
> find utility?
>
> For example, to write this:
>
> USE_DOS2UNIX= src/ libsrc/ *.cpp *.h docs/ *.html *.txt README
>
> to do that:
>
> find ${WRKSRC}/src/ ${WRKSRC}/libsrc/ -name *.cpp -or -name *.h -type f -print0 | xargs ...
> find ${WRKSRC}/docs/ -name *.html -or -name *.txt -or -name README -type f -print0 | xargs ...
>
> Syntax may be other (maybe multiline more like OPTIONS), that's point to
> discuss. But that surely will be a feature.
>
> If the idea gets accepted, I'll make patches.
>
>   

Sounds like a pretty reasonable idea. But I think USE_* is generally
just on/off switches, so maybe it needs to be a different name?


__________________________________________________
Frank Laszlo
System Administrator
The VonOstin Group
Email:  laszlof at tvog.net
WWW:    http://www.vonostingroup.com
Mobile: 248-863-7584




More information about the freebsd-ports mailing list