Bug 62298 - [PATCH] bsd.port.mk: eliminate verbatim `sort'
Summary: [PATCH] bsd.port.mk: eliminate verbatim `sort'
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-03 04:40 UTC by Oliver Eikemeier
Modified: 2004-12-09 22:11 UTC (History)
0 users

See Also:


Attachments
file.diff (2.96 KB, patch)
2004-02-03 04:40 UTC, Oliver Eikemeier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Eikemeier 2004-02-03 04:40:21 UTC
eliminate verbatim `sort' from bsd.port.mk
Comment 1 Kirill Ponomarev freebsd_committer freebsd_triage 2004-02-03 08:14:29 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

portmgr territory
Comment 2 Kris Kennaway freebsd_committer freebsd_triage 2004-03-21 02:20:42 UTC
State Changed
From-To: open->analyzed

Will be tested on the next bento 4-exp run
Comment 3 Oliver Eikemeier 2004-03-21 09:51:20 UTC
Kris Kennaway wrote:

> Synopsis: [PATCH] bsd.port.mk: eliminate verbatim `sort'
> 
> State-Changed-From-To: open->analyzed
> State-Changed-By: kris
> State-Changed-When: Sat Mar 20 18:20:42 PST 2004
> State-Changed-Why: 
> Will be tested on the next bento 4-exp run

Could you just ping me before doing the next bento run?
There are some additional variables used verbatim which
could be fixed.

Oliver
Comment 4 Kris Kennaway 2004-03-21 23:32:08 UTC
On Sun, Mar 21, 2004 at 10:51:20AM +0100, Oliver Eikemeier wrote:
> Kris Kennaway wrote:
> 
> >Synopsis: [PATCH] bsd.port.mk: eliminate verbatim `sort'
> >
> >State-Changed-From-To: open->analyzed
> >State-Changed-By: kris
> >State-Changed-When: Sat Mar 20 18:20:42 PST 2004
> >State-Changed-Why: 
> >Will be tested on the next bento 4-exp run
> 
> Could you just ping me before doing the next bento run?
> There are some additional variables used verbatim which
> could be fixed.

It will be in a few days, so can you submit the patch ASAP?

Kris
Comment 5 Oliver Eikemeier 2004-03-22 00:58:29 UTC
Kris Kennaway wrote:

> It will be in a few days, so can you submit the patch ASAP?

Try this one.

Thanks
    Oliver

Index: bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.484
diff -u -r1.484 bsd.port.mk
--- bsd.port.mk	4 Feb 2004 04:27:04 -0000	1.484
+++ bsd.port.mk	22 Mar 2004 00:56:24 -0000
@@ -912,6 +912,7 @@
 CP?=		/bin/cp
 CPIO?=		/usr/bin/cpio
 CUT?=		/usr/bin/cut
+DATE?=		/bin/date
 DC?=		/usr/bin/dc
 DIALOG?=	/usr/bin/dialog
 DIRNAME?=	/usr/bin/dirname
@@ -920,6 +921,7 @@
 FALSE?=		false				# Shell builtin
 FILE?=		/usr/bin/file
 FIND?=		/usr/bin/find
+FMT?=		/usr/bin/fmt
 GREP?=		/usr/bin/grep
 GUNZIP_CMD?=	/usr/bin/gunzip -f
 GZCAT?=		/usr/bin/gzcat
@@ -932,8 +934,10 @@
 LN?=		/bin/ln
 LS?=		/bin/ls
 MKDIR?=		/bin/mkdir -p
+MKTEMP?=	/usr/bin/mktemp
 MV?=		/bin/mv
 OBJCOPY?=	/usr/bin/objcopy
+OBJDUMP?=	/usr/bin/objdump
 PASTE?=		/usr/bin/paste
 PAX?=		/bin/pax
 PRINTF?=	/usr/bin/printf
@@ -2107,7 +2111,7 @@
 DISABLE_CONFLICTS=	YES
 .endif
 .if !defined(PKG_ARGS)
-PKG_ARGS=		-v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | sort -u`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS}
+PKG_ARGS=		-v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS}
 .if !defined(NO_MTREE)
 PKG_ARGS+=		-m ${MTREE_FILE}
 .endif
@@ -3068,7 +3072,7 @@
 	@if [ -f "${AUDITFILE}" ]; then \
 		audit_created=`${_EXTRACT_AUDITFILE} | \
 			${SED} -nEe "1s/^#CREATED: *([0-9]{4})-?([0-9]{2})-?([0-9]{2}).*$$/\1\2\3/p"`; \
-		audit_expiry=`date -u -v-14d "+%Y%m%d"`; \
+		audit_expiry=`${DATE} -u -v-14d "+%Y%m%d"`; \
 		if [ "$$audit_created" -lt "$$audit_expiry" ]; then \
 			${ECHO_MSG} "===>  WARNING: Vulnerability database out of date, checking anyway"; \
 		fi; \
@@ -3342,7 +3346,7 @@
 	    INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
 	    ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}; then \
 			 ${ECHO_CMD} "===>  Script \"${CONFIGURE_SCRIPT}\" failed unexpectedly."; \
-			 (${ECHO_CMD} ${CONFIGURE_FAIL_MESSAGE}) | /usr/bin/fmt 75 79 ; \
+			 (${ECHO_CMD} ${CONFIGURE_FAIL_MESSAGE}) | ${FMT} 75 79 ; \
 			 ${FALSE}; \
 		fi)
 .endif
@@ -3645,12 +3649,12 @@
 	| ${XARGS} -0 -J % ${FIND} % -prune -perm -0002 2> /dev/null > ${WRKDIR}/.PLIST.writable; \
 	${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
 	| ${XARGS} -0 -J % ${FIND} % -prune ! -type l -type f -print0 2> /dev/null \
-	| ${XARGS} -0 -n 1 /usr/bin/objdump -R 2> /dev/null > ${WRKDIR}/.PLIST.objdump; \
+	| ${XARGS} -0 -n 1 ${OBJDUMP} -R 2> /dev/null > ${WRKDIR}/.PLIST.objdump; \
 	if \
 		! ${AWK} -v audit="$${PORTS_AUDIT}" -f ${PORTSDIR}/Tools/scripts/security-check.awk \
 		  ${WRKDIR}/.PLIST.flattened ${WRKDIR}/.PLIST.objdump ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable; \
 	then \
-	    if [ ! -z "`make www-site`" ]; then \
+	    if [ ! -z "`${MAKE} www-site`" ]; then \
 			${ECHO_MSG}; \
 			${ECHO_MSG} "      For more information, and contact details about the security"; \
 			${ECHO_MSG} "      status of this software, see the following webpage: "; \
@@ -3678,7 +3682,7 @@
 	fi; \
 	for i in `${GREP} -v '^@' ${TMPPLIST}`; do \
 		if [ ! -L "${PREFIX}/$$i" -a -f "${PREFIX}/$$i" ]; then \
-			/usr/bin/objdump -R ${PREFIX}/$$i > \
+			${OBJDUMP} -R ${PREFIX}/$$i > \
 				${WRKDIR}/.PLIST.objdump 2> /dev/null; \
 			if [ -s ${WRKDIR}/.PLIST.objdump ] ; then \
 				${EGREP} " $$stupid_functions_regexp" \
@@ -3744,7 +3748,7 @@
 		${ECHO_MSG} "      risk to the system. FreeBSD makes no guarantee about the security of"; \
 		${ECHO_MSG} "      ports included in the Ports Collection. Please type 'make deinstall'"; \
 		${ECHO_MSG} "      to deinstall the port if this is a concern."; \
-	    if [ ! -z "`make www-site`" ]; then \
+	    if [ ! -z "`${MAKE} www-site`" ]; then \
 			${ECHO_MSG}; \
 			${ECHO_MSG} "      For more information, and contact details about the security"; \
 			${ECHO_MSG} "      status of this software, see the following webpage: "; \
@@ -4263,9 +4267,9 @@
 		  if [ "$${OK:=true}" = "retry" ] && [ ${FETCH_REGET} -gt 0 ]; then \
 			  ${ECHO_MSG} "===>  Refetch for ${FETCH_REGET} more times files: $$refetchlist"; \
 			  if ( cd ${.CURDIR} && \
-			    ${MAKE} ${.MAKEFLAGS} FORCE_FETCH="$$refetchlist" FETCH_REGET="`expr ${FETCH_REGET} - 1`" fetch); then \
+			    ${MAKE} ${.MAKEFLAGS} FORCE_FETCH="$$refetchlist" FETCH_REGET="`${EXPR} ${FETCH_REGET} - 1`" fetch); then \
 			  	  if ( cd ${.CURDIR} && \
-			        ${MAKE} ${.MAKEFLAGS} FETCH_REGET="`expr ${FETCH_REGET} - 1`" checksum ); then \
+			        ${MAKE} ${.MAKEFLAGS} FETCH_REGET="`${EXPR} ${FETCH_REGET} - 1`" checksum ); then \
 			  	      OK="true"; \
 			  	  fi; \
 			  fi; \
@@ -4501,7 +4505,7 @@
 		else \
 			${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
 		fi; \
-	done | sort -u
+	done | ${SORT} -u
 
 .if !target(clean-depends)
 clean-depends:
@@ -4605,13 +4609,13 @@
 .endif
 
 BUILD-DEPENDS-LIST= \
-	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u) $$(${ECHO_CMD} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u); do \
+	for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | ${SORT} -u); do \
 		if [ -d $$dir ]; then \
 			${ECHO_CMD} $$dir; \
 		else \
 			${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
 		fi; \
-	done | sort -u
+	done | ${SORT} -u
 
 run-depends-list:
 .if defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS)
@@ -4619,13 +4623,13 @@
 .endif
 
 RUN-DEPENDS-LIST= \
-	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':' | sort -u) $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':' | sort -u); do \
+	for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':' | ${SORT} -u); do \
 		if [ -d $$dir ]; then \
 			${ECHO_CMD} $$dir; \
 		else \
 			${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
 		fi; \
-	done | sort -u
+	done | ${SORT} -u
 
 # Package (recursive runtime) dependency list.  Print out both directory names
 # and package names.
@@ -4976,7 +4980,7 @@
 		if [ -f ${PKGMESSAGE} ]; then \
 			${CP} ${PKGMESSAGE} ${PKG_DBDIR}/${PKGNAME}/+DISPLAY; \
 		fi; \
-		for dep in `${PKG_INFO} -qf ${PKGNAME} | ${GREP} -w ^@pkgdep | ${AWK} '{print $$2}' | sort -u`; do \
+		for dep in `${PKG_INFO} -qf ${PKGNAME} | ${GREP} -w ^@pkgdep | ${AWK} '{print $$2}' | ${SORT} -u`; do \
 			if [ -d ${PKG_DBDIR}/$$dep -a -z `${ECHO_CMD} $$dep | ${GREP} -E ${PKG_IGNORE_DEPENDS}` ]; then \
 				if ! ${GREP} ^${PKGNAME}$$ ${PKG_DBDIR}/$$dep/+REQUIRED_BY \
 					>/dev/null 2>&1; then \
@@ -5068,7 +5072,7 @@
 		DEFOPTIONS="$${DEFOPTIONS} $$1 \"$$2\" $${val}"; \
 		shift 3; \
 	done; \
-	TMPOPTIONSFILE=$$(mktemp -t portoptions); \
+	TMPOPTIONSFILE=$$(${MKTEMP} -t portoptions); \
 	trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
 	${SH} -c "${DIALOG} --checklist \"Options for ${PKGNAME:C/-([^-]+)$/ \1/}\" 21 70 15 $${DEFOPTIONS} 2> $${TMPOPTIONSFILE}"; \
 	status=$$?; \
@@ -5083,7 +5087,7 @@
 	fi; \
 	SELOPTIONS=$$(${CAT} $${TMPOPTIONSFILE}); \
 	${RM} -f $${TMPOPTIONSFILE}; \
-	TMPOPTIONSFILE=$$(mktemp -t portoptions); \
+	TMPOPTIONSFILE=$$(${MKTEMP} -t portoptions); \
 	trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
 	${ECHO_CMD} "# This file is auto-generated by 'make config'." > $${TMPOPTIONSFILE}; \
 	${ECHO_CMD} "# No user-servicable parts inside!" >> $${TMPOPTIONSFILE}; \
Comment 6 Kirill Ponomarev freebsd_committer freebsd_triage 2004-12-09 22:11:24 UTC
State Changed
From-To: analyzed->closed

Committed, thanks!