From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Feb 1 16:30:14 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 [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 055FB16A423 for ; Wed, 1 Feb 2006 16:30:13 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E289843D46 for ; Wed, 1 Feb 2006 16:30:10 +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 k11GUAaI091397 for ; Wed, 1 Feb 2006 16:30:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k11GUAdm091396; Wed, 1 Feb 2006 16:30:10 GMT (envelope-from gnats) Resent-Date: Wed, 1 Feb 2006 16:30:10 GMT Resent-Message-Id: <200602011630.k11GUAdm091396@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, "Alejandro Pulver" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 36AA616A420 for ; Wed, 1 Feb 2006 16:27:51 +0000 (GMT) (envelope-from alejandro@varnet.biz) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by mx1.FreeBSD.org (Postfix) with SMTP id B112A43D4C for ; Wed, 1 Feb 2006 16:27:50 +0000 (GMT) (envelope-from alejandro@varnet.biz) Received: (qmail 77479 invoked from network); 1 Feb 2006 16:27:49 -0000 Received: from unknown (HELO phobos.mars.bsd) (unknown) by unknown with SMTP; 1 Feb 2006 16:27:49 -0000 Message-Id: <1138811269.0@phobos.mars.bsd> Date: Wed, 1 Feb 2006 13:27:49 -0300 From: "Alejandro Pulver" To: "FreeBSD gnats submit" X-Send-Pr-Version: gtk-send-pr 0.4.6 Cc: Subject: ports/92688: [PATCH] bsd.port.mk: add check to USE_DOS2UNIX X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2006 16:30:14 -0000 >Number: 92688 >Category: ports >Synopsis: [PATCH] bsd.port.mk: add check to USE_DOS2UNIX >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Wed Feb 01 16:30:10 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Alejandro Pulver >Release: FreeBSD 5.4-RELEASE i386 >Organization: >Environment: System: FreeBSD 5.4-RELEASE #0: Sat May 21 12:14:47 ART 2005 root@ale.varnet.bsd:/usr/src/sys/i386/compile/ATHLON-ALE >Description: This patch adds DOS text files detection support for the "patch-dos2unix target", and only removes the (one) trailing CR (\r) character. This is because the conversion can (actually does) damage non-text files. Also the current version will delete all control characters at the end of the line, not only a CR (this can produce unexpected results). >How-To-Repeat: >Fix: --- bsd.port.mk.diff begins here --- --- /usr/ports/Mk/bsd.port.mk Fri Jan 27 23:11:05 2006 +++ bsd.port.mk Wed Feb 1 13:22:04 2006 @@ -3231,12 +3231,15 @@ .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:]]*$$//' + @${FIND} ${WRKSRC} -type f -print0 | ${XARGS} -0 ${SH} -c \ + 'while [ $$# -gt 0 ]; do ${FILE} "$$1" | ${GREP} -q CRLF && \ + ${REINPLACE_CMD} -i"" -e "s/`${PRINTF} \"\r\"`$$//" "$$1"; \ + shift; done' sep .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} + @${FILE} "${WRKSRC}/${f}" | ${GREP} -q CRLF && \ + ${REINPLACE_CMD} -i"" -e "s/`${PRINTF} '\r'`$$//" "${WRKSRC}/${f}" .endfor .endif .else --- bsd.port.mk.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: