Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Feb 2006 09:16:17 -0500
From:      Frank Laszlo <laszlof@vonostingroup.com>
To:        Sergey Matveychuk <sem@FreeBSD.org>
Cc:        amdmi3@mail.ru, freebsd-ports@freebsd.org
Subject:   Re: USE_DOS2UNIX may be more powerful?
Message-ID:  <43E8ABB1.5020606@vonostingroup.com>
In-Reply-To: <b8a404110602070606s6a0df93ah@mail.gmail.com>
References:  <20060207003529.GA32317@hades.panopticon>	 <43E8A5DD.5000509@vonostingroup.com> <b8a404110602070606s6a0df93ah@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Sergey Matveychuk wrote:
> 2006/2/7, Frank Laszlo <laszlof@vonostingroup.com
> <mailto:laszlof@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43E8ABB1.5020606>