USE_DOS2UNIX may be more powerful?

Frank Laszlo laszlof at vonostingroup.com
Tue Feb 7 06:16:20 PST 2006


Sergey Matveychuk wrote:
> 2006/2/7, Frank Laszlo <laszlof at vonostingroup.com
> <mailto:laszlof at vonostingroup.com>>:
>
>     Dmitry Marakasov wrote:
>     >
>     > 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?
>
>
> We already have USE_*=list. E.g. USE_GNOME, USE_RCORDER etc.
>
> But I think using of something like DOS2UNIX_FILES name will be better
> in the case.
>
> 2Dmitry: patches are always welcome.
>
Ha, I just noticed it already does this. Look at the code:

.if defined(USE_DOS2UNIX)
.if ${USE_DOS2UNIX:U}=="YES"
    @${ECHO_MSG} "===>   Converting DOS text files to UNIX text files"
    @${FIND} -E ${WRKSRC} -type f -print0 | \
            ${XARGS} -0 ${REINPLACE_CMD} -i"" -e 's/[[:cntrl:]]*$$//'
.else
.for f in ${USE_DOS2UNIX}
    @${ECHO_MSG} "===>   Converting DOS text file to UNIX text file: ${f}"
    @${REINPLACE_CMD} -i"" -e 's/[[:cntrl:]]*$$//' ${WRKSRC}/${f}
.endfor
.endif

So you can define it either way..

USE_DOS2UNIX=YES    <-- this will parse ALL files within WRKSRC
USE_DOS2UNIX=foo/*.c bar/biz/*.h    <-- this will parse only certain files.

Hope this helps.

-Frank


More information about the freebsd-ports mailing list