From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Nov 29 20:00:38 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C56A16A40F for ; Wed, 29 Nov 2006 20:00:38 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id D381643CA5 for ; Wed, 29 Nov 2006 20:00:33 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id kATK0bk0065043 for ; Wed, 29 Nov 2006 20:00:37 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id kATK0afR065041; Wed, 29 Nov 2006 20:00:37 GMT (envelope-from gnats) Resent-Date: Wed, 29 Nov 2006 20:00:37 GMT Resent-Message-Id: <200611292000.kATK0afR065041@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Pav Lucistnik Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D2F916A403 for ; Wed, 29 Nov 2006 19:56:58 +0000 (UTC) (envelope-from pav@oook.cz) Received: from hood.oook.cz (hood.oook.cz [195.250.137.134]) by mx1.FreeBSD.org (Postfix) with ESMTP id DAAF643CD8 for ; Wed, 29 Nov 2006 19:56:34 +0000 (GMT) (envelope-from pav@oook.cz) Received: from ikaros.oook.cz (localhost [127.0.0.1]) by hood.oook.cz (8.13.8/8.13.8) with ESMTP id kATJuanr031267 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 29 Nov 2006 20:56:36 +0100 (CET) (envelope-from pav@ikaros.oook.cz) Received: (from pav@localhost) by ikaros.oook.cz (8.13.8/8.13.8/Submit) id kATJuav6031266; Wed, 29 Nov 2006 20:56:36 +0100 (CET) (envelope-from pav) Message-Id: <200611291956.kATJuav6031266@ikaros.oook.cz> Date: Wed, 29 Nov 2006 20:56:36 +0100 (CET) From: Pav Lucistnik To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/106029: USE_DOS2UNIX improvement X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Pav Lucistnik List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Nov 2006 20:00:38 -0000 >Number: 106029 >Category: ports >Synopsis: USE_DOS2UNIX improvement >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Nov 29 20:00:36 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Pav Lucistnik >Release: FreeBSD 6.2-PRERELEASE amd64 >Organization: >Environment: System: FreeBSD ikaros.oook.cz 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Thu Sep 28 19:10:00 CEST 2006 root@ikaros.oook.cz:/usr/obj/usr/src/sys/SMP amd64 >Description: Improvements to current feature USE_DOS2UNIX (replace DOS linefeeds with UNIX ones): - allows to specify generic file extensions, which will be then searched and patched in the whole directory tree USE_DOS2UNIX= *.cpp *.h - backwards compatible: retains old behaviour if slash is used in the expression USE_DOS2UNIX= src/config.h - new variable to specify find(1) iregex argument USE_DOS2UNIX= yes DOS2UNIX_REGEX= .*\.(cpp|h) Superseeds ports/93007. >How-To-Repeat: >Fix: Also available on freefall as ~pav/dos2unix.patch --- dos2unix.patch begins here --- Index: bsd.port.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v retrieving revision 1.544 diff -a -u -r1.544 bsd.port.mk --- bsd.port.mk 30 Sep 2006 19:25:45 -0000 1.544 +++ bsd.port.mk 29 Nov 2006 19:51:10 -0000 @@ -299,6 +299,9 @@ # USE_DOS2UNIX - If set to "YES", remove the ^M from all files # under ${WRKSRC}. If set to a string, remove in all # files under ${WRKSRC} with one of these names the ^Ms. +# DOS2UNIX_REGEX +# - Limit the ^M removal to files which name matches +# the regular expression. # USE_GCC - If set, this port requires this version of gcc, either in # the system or installed from a port. # USE_GMAKE - If set, this port uses gmake. @@ -1268,6 +1271,8 @@ .endif +DOS2UNIX_REGEX?= .* + # Start of pre-makefile section. .if !defined(AFTERPORTMK) && !defined(INOPTIONSMK) @@ -3480,13 +3485,20 @@ .if defined(USE_DOS2UNIX) .if ${USE_DOS2UNIX:U}=="YES" @${ECHO_MSG} "===> Converting DOS text files to UNIX text files" - @${FIND} ${WRKSRC} -type f -print0 | \ + @${FIND} -E ${WRKSRC} -type f -iregex '${DOS2UNIX_REGEX}' -print0 | \ ${XARGS} -0 ${REINPLACE_CMD} -i '' -e 's/ $$//' .else -.for f in ${USE_DOS2UNIX} @${ECHO_MSG} "===> Converting DOS text file to UNIX text file: ${f}" +.if ${USE_DOS2UNIX:M*/*} +.for f in ${USE_DOS2UNIX} @${REINPLACE_CMD} -i '' -e 's/ $$//' ${WRKSRC}/${f} .endfor +.else +.for f in ${USE_DOS2UNIX} + @${FIND} ${WRKSRC} -type f -name '${f}' -print0 | \ + ${XARGS} -0 ${REINPLACE_CMD} -i '' -e 's/ $$//' +.endfor +.endif .endif .else @${DO_NADA} --- dos2unix.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: