ports/184168: [exp-run] [bsd.port.mk] replace USE_DOS2UNIX implementation

Rene Ladan rene at FreeBSD.org
Fri Nov 22 11:20:00 UTC 2013


>Number:         184168
>Category:       ports
>Synopsis:       [exp-run] [bsd.port.mk] replace USE_DOS2UNIX implementation
>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:   Fri Nov 22 11:20:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Rene Ladan
>Release:        FreeBSD 10.0-BETA3-amd64
>Organization:
>Environment:
FreeBSD 10.0-BETA3-amd64
Ports r334571
>Description:
USE_DOS2UNIX has been deprecated in favor of USES=dos2unix.

Replace the code for this variable by an inclusion of this USES together with some compatibility glue code, and remove the describing comments at the top.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: Mk/bsd.port.mk
===================================================================
--- Mk/bsd.port.mk	(revision 334495)
+++ Mk/bsd.port.mk	(working copy)
@@ -330,12 +330,6 @@
 #				  for compression.
 # USE_MAKESELF		- If set, this port distfile uses makeself, not tar w/[bg]zip
 #				  for compression.
-# 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_CSTD		- Override the default C language standard (gnu89, gnu99)
@@ -1290,8 +1235,6 @@
 
 .endif
 
-DOS2UNIX_REGEX?=	.*
-
 # At least KDE needs TMPDIR for the package building,
 # so we're setting it to the known default value.
 .if defined(PACKAGE_BUILDING)
@@ -3601,33 +3528,17 @@
 
 # Patch
 
-.if !target(patch-dos2unix)
-patch-dos2unix:
 .if defined(USE_DOS2UNIX)
-.if ${USE_DOS2UNIX:U}=="YES"
-	@${ECHO_MSG} "===>   Converting DOS text files to UNIX text files"
-	@${FIND} -E ${WRKSRC} -type f -iregex '${DOS2UNIX_REGEX}' -print0 | \
-			${XARGS} -0 ${REINPLACE_CMD} -i '' -e 's/-$$//'
-.else
+.if ${USE_DOS2UNIX:U} == "YES"
+	_DOS2UNIX_ALL=	yes
+.endif
 .if ${USE_DOS2UNIX:M*/*}
-.for f in ${USE_DOS2UNIX}
-	@${ECHO_MSG} "===>   Converting DOS text file to UNIX text file: ${f}"
-	@${REINPLACE_CMD} -i '' -e 's/-$$//' ${WRKSRC}/${f}
-.endfor
+	DOS2UNIX_FILES+=	${USE_DOS2UNIX}
 .else
-.for f in ${USE_DOS2UNIX}
-	@${FIND} ${WRKSRC} -type f -name '${f}' -print0 | \
-			${XARGS} -0 ${REINPLACE_CMD} -i '' -e 's/-$$//'
-.endfor
+	DOS2UNIX_GLOB+=	${USE_DOS2UNIX}
 .endif
+USES+=	dos2unix
 .endif
-.else
-	@${DO_NADA}
-.endif
-.endif
 
 .if !target(do-patch)
 do-patch:
 .if defined(PATCHFILES)
 	@${ECHO_MSG} "===>  Applying distribution patches for ${PKGNAME}"
	@(set -e; \
 	cd ${_DISTDIR}; \
 	patch_dist_strip () { \
 		case "$$1" in \
@@ -4386,7 +4297,7 @@
 				pre-extract pre-extract-script do-extract \
 				post-extract post-extract-script
 _PATCH_DEP=		extract
-_PATCH_SEQ=		ask-license patch-message patch-depends patch-dos2unix pre-patch \
+_PATCH_SEQ=		ask-license patch-message patch-depends pre-patch \
 				pre-patch-script do-patch post-patch post-patch-script
 _CONFIGURE_DEP=	patch
 _CONFIGURE_SEQ=	build-depends lib-depends configure-message run-autotools-fixup \


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list