Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 May 2011 09:27:24 -0700 (PDT)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/157273: [PATCH] some cleanup on bsd.port.mk
Message-ID:  <4dda8aec.6ae8d80a.412a.6e3a@mx.google.com>
Resent-Message-ID: <201105231630.p4NGU93Y050096@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         157273
>Category:       ports
>Synopsis:       [PATCH] some cleanup on bsd.port.mk
>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:   Mon May 23 16:30:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Baptiste Daroussin
>Release:        FreeBSD 8.2-STABLE amd64
>Organization:
>Environment:
System: FreeBSD azathoth.lan 8.2-STABLE FreeBSD 8.2-STABLE #0 r219454M: Thu Mar 10 20:09:22 CET 2011 root@azathoth.lan:/usr/obj/usr/src/sys/AZATHOTH amd64


	
>Description:
	this patch supersedes ports/155629 and ports/65804 + add some new cleanups

>How-To-Repeat:
	
>Fix:

	

--- cleanup-b.p.mk.patch begins here ---
Index: bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.683
diff -u -r1.683 bsd.port.mk
--- bsd.port.mk	17 May 2011 19:30:02 -0000	1.683
+++ bsd.port.mk	23 May 2011 16:16:41 -0000
@@ -1173,7 +1173,7 @@
 
 .if !target(makepatch)
 makepatch:
-	@cd ${.CURDIR} && ${MKDIR} ${FILESDIR}
+	@${MKDIR} ${FILESDIR}
 	@(cd ${PATCH_WRKSRC}; \
 		for i in `find . -type f -name '*.orig'`; do \
 			ORG=$$i; \
@@ -1191,11 +1191,6 @@
 # Start of options section
 .if defined(INOPTIONSMK) || ( !defined(USEOPTIONSMK) && !defined(AFTERPORTMK) )
 
-.if defined(MAKE_VERSION)
-.if ${MAKE_VERSION} >= 5200408030 || ${MAKE_VERSION} >= 4200408030 && ${MAKE_VERSION} < 5000000000
-NOPRECIOUSSOFTMAKEVARS= yes
-.endif
-.endif
 
 # Get the default maintainer
 MAINTAINER?=	ports@FreeBSD.org
@@ -2975,12 +2970,10 @@
 
 check-categories:
 .for cat in ${CATEGORIES}
-	@if ${ECHO_CMD} ${VALID_CATEGORIES} | ${GREP} -wq ${cat}; then \
-		${TRUE}; \
-	else \
-		${ECHO_MSG} "${PKGNAME}: Makefile error: category ${cat} not in list of valid categories."; \
-		${FALSE}; \
-	fi
+.	if empty(VALID_CATEGORIES:M${cat})
+		@${ECHO_MSG} "${PKGNAME}: Makefile error: category ${cat} not in list of valid categories."; \
+		${FALSE};
+.	endif
 .endfor
 .endif
 
@@ -4849,7 +4842,7 @@
 	for _file in ${DISTFILES}; do \
 		file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
 		select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
-		if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
+		if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f $${file##*/} ]; then \
 			if [ ! -z "$$select" ] ; then \
 				__MASTER_SITES_TMP= ; \
 				for group in $$select; do \
@@ -4865,7 +4858,7 @@
 			fi ; \
 			for site in `eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
 				DIR=${DIST_SUBDIR}; \
-				CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${DISTINFO_FILE} | ${AWK} '{print $$4}'`; \
+				CKSIZE=`${AWK} "/^SIZE \($${DIR:+$$DIR/}$$file\)"'{print $$4}' ${DISTINFO_FILE}`; \
 				case $${file} in \
 				*/*)	args="-o $${file} $${site}$${file}";; \
 				*)		args=$${site}$${file};; \
@@ -4880,7 +4873,7 @@
 	for _file in ${PATCHFILES}; do \
 		file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
 		select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
-		if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
+		if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f $${file##*/} ]; then \
 			if [ ! -z "$$select" ] ; then \
 				__PATCH_SITES_TMP= ; \
 				for group in $$select; do \
@@ -4896,7 +4889,7 @@
 			fi ; \
 			for site in `eval $$SORTED_PATCH_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
 				DIR=${DIST_SUBDIR}; \
-				CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${DISTINFO_FILE} | ${AWK} '{print $$4}'`; \
+				CKSIZE=`${AWK} "/^SIZE \($${DIR:+$$DIR/}$$file\)"'{print $$4}' ${DISTINFO_FILE}`; \
 				case $${file} in \
 				*/*)	args="-o $${file} $${site}$${file}";; \
 				*)		args=$${site}$${file};; \
@@ -5163,15 +5156,15 @@
 .if defined(${deptype}_DEPENDS)
 .if !defined(NO_DEPENDS)
 	@for i in `${ECHO_CMD} "${${deptype}_DEPENDS}"`; do \
-		prog=`${ECHO_CMD} $$i | ${SED} -e 's/:.*//'`; \
+		prog=$${i%%:*}; \
 		if [ -z "$$prog" ]; then \
 			${ECHO_MSG} "Error: there is an empty port dependency in ${deptype}_DEPENDS."; \
 			break; \
 		fi; \
-		dir=`${ECHO_CMD} $$i | ${SED} -e 's/[^:]*://'`; \
+		dir=$${i##*:}; \
 		if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
-			target=`${ECHO_CMD} $$dir | ${SED} -e 's/.*://'`; \
-			dir=`${ECHO_CMD} $$dir | ${SED} -e 's/:.*//'`; \
+			target=$${dir##*:}; \
+			dir=$${dir%%:*}; \
 			if [ X${DEPENDS_PRECLEAN} != "X" ]; then \
 				target="clean $$target"; \
 				depends_args="$$depends_args NOCLEANDEPENDS=yes"; \
@@ -6099,14 +6092,6 @@
 tags:
 .endif
 
-.if !defined(NOPRECIOUSSOFTMAKEVARS)
-.for softvar in CKSUMFILES _MLINKS
-.if defined(${softvar})
-__softMAKEFLAGS+=      '${softvar}+=${${softvar}:S/'/'\''/g}'
-.endif
-.endfor
-.endif
-
 .if !defined(NOPRECIOUSMAKEVARS)
 # These won't change, so we can pass them through the environment
 .MAKEFLAGS: \
--- cleanup-b.p.mk.patch ends here ---


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4dda8aec.6ae8d80a.412a.6e3a>