ports/61684: [PATCH] bsd.port.subdir.mk: cleanup

Oliver Eikemeier eikemeier at fillmore-labs.com
Wed Jan 21 20:01:22 UTC 2004


>Number:         61684
>Category:       ports
>Synopsis:       [PATCH] bsd.port.mk: cleanup
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 21 12:00:35 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Oliver Eikemeier
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
Fillmore Labs - http://www.fillmore-labs.com
>Environment:
System: FreeBSD nuuk.fillmore-labs.com 4.9-STABLE

>Description:

- elimintae verbatim use of dirname, id, rm

- this patch applies to revision 1.480 of bsd.port.mk
  + enhanced OPTIONS handling patch (previous PR)

>How-To-Repeat:
>Fix:

--- Mk/bsd.port.mk.orig	Wed Jan 21 20:33:40 2004
+++ Mk/bsd.port.mk	Wed Jan 21 20:34:30 2004
@@ -899,6 +899,7 @@
 CUT?=		/usr/bin/cut
 DC?=		/usr/bin/dc
 DIALOG?=	/usr/bin/dialog
+DIRNAME?=	/usr/bin/dirname
 EGREP?=		/usr/bin/egrep
 EXPR?=		/bin/expr
 FALSE?=		false				# Shell builtin
@@ -1957,7 +1958,7 @@
 MTREE_ARGS?=	-U ${MTREE_FOLLOWS_SYMLINKS} -f ${MTREE_FILE} -d -e -p
 
 # Determine whether or not we can use rootly owner/group functions.
-UID!=	id -u
+UID!=	${ID} -u
 .if ${UID} == 0
 _BINOWNGRP=	-o ${BINOWN} -g ${BINGRP}
 _SHROWNGRP=	-o ${SHAREOWN} -g ${SHAREGRP}
@@ -3139,7 +3140,7 @@
 		fi \
 	done
 .if !defined(EXTRACT_PRESERVE_OWNERSHIP)
-	@if [ `id -u` = 0 ]; then \
+	@if [ `${ID} -u` = 0 ]; then \
 		${CHMOD} -R ug-s ${WRKDIR}; \
 		${CHOWN} -R 0:0 ${WRKDIR}; \
 	fi
@@ -3231,7 +3232,7 @@
 	fi
 .if defined(GNU_CONFIGURE)
 	@CONFIG_GUESS_DIRS=$$(${FIND} ${WRKDIR} -name config.guess -o -name config.sub \
-		| ${XARGS} -n 1 /usr/bin/dirname); \
+		| ${XARGS} -n 1 ${DIRNAME}); \
 	for _D in $${CONFIG_GUESS_DIRS}; do \
 		${CP} -f ${TEMPLATES}/config.guess $${_D}/config.guess; \
 		${CHMOD} a+rx $${_D}/config.guess; \
@@ -3476,7 +3477,7 @@
 .if !target(install-mtree)
 install-mtree:
 	@${MKDIR} ${PREFIX}
-	@if [ `id -u` != 0 ]; then \
+	@if [ `${ID} -u` != 0 ]; then \
 		if [ -w ${PREFIX}/ ]; then \
 			${ECHO_MSG} "Warning: not superuser, you may get some errors during installation."; \
 		else \
@@ -3485,7 +3486,7 @@
 		fi; \
 	fi
 .if !defined(NO_MTREE)
-	@if [ `id -u` = 0 ]; then \
+	@if [ `${ID} -u` = 0 ]; then \
 		if [ ! -f ${MTREE_FILE} ]; then \
 			${ECHO_CMD} "Error: mtree file \"${MTREE_FILE}\" is missing."; \
 			${ECHO_CMD} "Copy it from a suitable location (e.g., /usr/src/etc/mtree) and try again."; \
@@ -3568,7 +3569,7 @@
 #   4.  startup scripts, in conjunction with 2.
 #   5.  world-writable files/dirs
 #
-	- at rm -f ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.stupid \
+	-@${RM} -f ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.stupid \
 		${WRKDIR}/.PLIST.network ${WRKDIR}/.PLIST.writable; \
 	if [ -n "$$PORTS_AUDIT" ]; then \
 		stupid_functions_regexp=' (gets|mktemp|tempnam|tmpnam|strcpy|strcat|sprintf)$$'; \
@@ -4643,7 +4644,7 @@
 
 .if !target(readme)
 readme:
-	@rm -f ${.CURDIR}/README.html
+	@${RM} -f ${.CURDIR}/README.html
 	@cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} ${.CURDIR}/README.html
 .endif
 
@@ -4698,7 +4699,7 @@
 .if !target(generate-plist)
 generate-plist:
 	@${ECHO_MSG} "===>   Generating temporary packing list"
-	@${MKDIR} `dirname ${TMPPLIST}`
+	@${MKDIR} `${DIRNAME} ${TMPPLIST}`
 	@if [ ! -f ${DESCR} ]; then ${ECHO_CMD} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi
 	@>${TMPPLIST}
 	@for file in ${PLIST_FILES}; do \
@@ -4921,8 +4922,8 @@
 	@${ECHO_MSG} "===> Using wrong configuration file ${_OPTIONSFILE}"
 	@exit 1
 .endif
-	@(${MKDIR} `dirname ${_OPTIONSFILE}` 2> /dev/null) || \
-		(${ECHO_MSG} "===> Cannot create `dirname ${_OPTIONSFILE}`, check permissions"; exit 1)
+	@(${MKDIR} `${DIRNAME} ${_OPTIONSFILE}` 2> /dev/null) || \
+		(${ECHO_MSG} "===> Cannot create `${DIRNAME} ${_OPTIONSFILE}`, check permissions"; exit 1)
 	- at if [ -e ${_OPTIONSFILE} ]; then \
 		. ${_OPTIONSFILE}; \
 	fi; \
@@ -5011,7 +5012,7 @@
 .if defined(OPTIONS) && exists(${_OPTIONSFILE})
 	-@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \
 	${RM} -f ${_OPTIONSFILE}; \
-	${RMDIR} `dirname ${_OPTIONSFILE}`
+	${RMDIR} `${DIRNAME} ${_OPTIONSFILE}`
 .else
 	@${ECHO_MSG} "===> No user-specified options configured for ${PKGNAME}"
 .endif


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



More information about the freebsd-ports-bugs mailing list