ports/165623: Mk/bsd.comands.mk et al -- conflicting uses of ${FILE}
Matthew Seaman
matthew at FreeBSD.org
Fri Mar 2 14:00:21 UTC 2012
>Number: 165623
>Category: ports
>Synopsis: Mk/bsd.comands.mk et al -- conflicting uses of ${FILE}
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Mar 02 14:00:21 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Matthew Seaman
>Release: FreeBSD 8.3-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD lucid-nonsense.infracaninophile.co.uk 8.3-PRERELEASE FreeBSD 8.3-PRERELEASE #4 r232170: Sun Feb 26 10:27:22 GMT 2012 root at lucid-nonsense.infracaninophile.co.uk:/usr/obj/usr/src/sys/LUCID-NONSENSE amd64
>Description:
bsd.commands.mk has:
FILE?= /usr/bin/file
but by far the most common use of ${FILE} in the ports is as a loop
control variable for iterating through a list of files. This seems
contrary and undesirable.
Therefore change the variable to ${FILE_CMD} when the meaning is to
run the file(1) application. There are only 10 instances that I can
find by exhaustive search of the ports.
Tinderbox results: https://redports.org/buildarchive/20120301135606-15513/
>How-To-Repeat:
>Fix:
--- FILE_CMD.diff begins here ---
Index: Mk/bsd.commands.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.commands.mk,v
retrieving revision 1.10
diff -u -u -r1.10 bsd.commands.mk
--- Mk/bsd.commands.mk 22 Feb 2012 17:34:47 -0000 1.10
+++ Mk/bsd.commands.mk 1 Mar 2012 12:12:45 -0000
@@ -39,7 +39,7 @@
EGREP?= /usr/bin/egrep
EXPR?= /bin/expr
FALSE?= false # Shell builtin
-FILE?= /usr/bin/file
+FILE_CMD?= /usr/bin/file # FILE is a commonly used variable
FIND?= /usr/bin/find
FLEX?= /usr/bin/flex
FMT?= /usr/bin/fmt
Index: Mk/bsd.linux-rpm.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.linux-rpm.mk,v
retrieving revision 1.26
diff -u -u -r1.26 bsd.linux-rpm.mk
--- Mk/bsd.linux-rpm.mk 18 Apr 2011 13:07:21 -0000 1.26
+++ Mk/bsd.linux-rpm.mk 1 Mar 2012 12:13:02 -0000
@@ -187,7 +187,7 @@
do-install:
. if ${BRANDELF_DIRS}
@cd ${WRKSRC} && ${FIND} ${BRANDELF_DIRS} -type f -print0 \
- | ${XARGS} -0 ${FILE} | ${GREP} ELF | ${CUT} -d : -f 1 \
+ | ${XARGS} -0 ${FILE_CMD} | ${GREP} ELF | ${CUT} -d : -f 1 \
| ${XARGS} ${BRANDELF} -t Linux
. endif
. if ${BRANDELF_FILES}
Index: emulators/linux_base-f10/Makefile
===================================================================
RCS file: /home/ncvs/ports/emulators/linux_base-f10/Makefile,v
retrieving revision 1.61
diff -u -u -r1.61 Makefile
--- emulators/linux_base-f10/Makefile 21 Jul 2011 04:39:21 -0000 1.61
+++ emulators/linux_base-f10/Makefile 1 Mar 2012 12:08:21 -0000
@@ -190,7 +190,7 @@
# @${CHMOD} u+w ${WRKSRC}/usr/bin/*db4*
@${FIND} ${WRKSRC}/bin ${WRKSRC}/sbin/ ${WRKSRC}/usr/bin \
- ${WRKSRC}/usr/sbin -type f -print0 | ${XARGS} -0 ${FILE} \
+ ${WRKSRC}/usr/sbin -type f -print0 | ${XARGS} -0 ${FILE_CMD} \
| ${GREP} ELF | ${CUT} -d : -f 1 \
| ${XARGS} ${BRANDELF} -t Linux
@${BRANDELF} -t Linux ${WRKSRC}/lib/ld-2.9.so
Index: emulators/linux_base-fc4/Makefile
===================================================================
RCS file: /home/ncvs/ports/emulators/linux_base-fc4/Makefile,v
retrieving revision 1.37
diff -u -u -r1.37 Makefile
--- emulators/linux_base-fc4/Makefile 7 Mar 2011 15:08:19 -0000 1.37
+++ emulators/linux_base-fc4/Makefile 1 Mar 2012 12:07:57 -0000
@@ -167,7 +167,7 @@
@${CHMOD} u+w ${WRKSRC}/usr/bin/*db4*
@${FIND} ${WRKSRC}/bin ${WRKSRC}/sbin/ ${WRKSRC}/usr/bin \
- ${WRKSRC}/usr/sbin -type f -print0 | ${XARGS} -0 ${FILE} \
+ ${WRKSRC}/usr/sbin -type f -print0 | ${XARGS} -0 ${FILE_CMD} \
| ${GREP} ELF | ${CUT} -d : -f 1 \
| ${XARGS} ${BRANDELF} -t Linux
@${BRANDELF} -t Linux ${WRKSRC}/lib/ld-2.3.6.so
Index: emulators/linux_dist-gentoo-stage3/Makefile
===================================================================
RCS file: /home/ncvs/ports/emulators/linux_dist-gentoo-stage3/Makefile,v
retrieving revision 1.37
diff -u -u -r1.37 Makefile
--- emulators/linux_dist-gentoo-stage3/Makefile 7 Feb 2012 17:56:41 -0000 1.37
+++ emulators/linux_dist-gentoo-stage3/Makefile 1 Mar 2012 12:12:56 -0000
@@ -107,7 +107,7 @@
@${CP} -p /etc/resolv.conf ${PREFIX}/${PREFIX_SUBDIR}/etc/
@${FIND} ${PREFIX}/${PREFIX_SUBDIR}bin ${PREFIX}/${PREFIX_SUBDIR}sbin/ \
${PREFIX}/${PREFIX_SUBDIR}usr/bin ${PREFIX}/${PREFIX_SUBDIR}/usr/sbin \
- -type f -print0 | ${XARGS} -0 ${FILE} \
+ -type f -print0 | ${XARGS} -0 ${FILE_CMD} \
| ${GREP} ELF | ${CUT} -d : -f 1 | ${XARGS} ${BRANDELF} -t Linux
@${BRANDELF} -t Linux ${PREFIX}/${PREFIX_SUBDIR}/lib/ld-*.so
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
Index: games/doom-data/Makefile.include
===================================================================
RCS file: /home/ncvs/ports/games/doom-data/Makefile.include,v
retrieving revision 1.3
diff -u -u -r1.3 Makefile.include
--- games/doom-data/Makefile.include 24 Apr 2006 21:03:30 -0000 1.3
+++ games/doom-data/Makefile.include 1 Mar 2012 12:13:00 -0000
@@ -25,7 +25,7 @@
. else
pre-patch:
@${FIND} ${WRKDIR} -type f -print0 | \
- ${XARGS} -0 ${FILE} | ${GREP} 'CRLF' | \
+ ${XARGS} -0 ${FILE_CMD} | ${GREP} 'CRLF' | \
${SED} -e "s/:.*//" | ${SED} -e 's/ /\\ /g' | \
${XARGS} ${REINPLACE_CMD} -i "" -e "s/`${PRINTF} '\r'`$$//"
. endif
Index: games/linux-enemyterritory-etpub/Makefile
===================================================================
RCS file: /home/ncvs/ports/games/linux-enemyterritory-etpub/Makefile,v
retrieving revision 1.11
diff -u -u -r1.11 Makefile
--- games/linux-enemyterritory-etpub/Makefile 27 Feb 2011 04:54:29 -0000 1.11
+++ games/linux-enemyterritory-etpub/Makefile 1 Mar 2012 12:13:01 -0000
@@ -39,7 +39,7 @@
pre-patch:
@${FIND} ${WRKSRC} -type f -exec ${SH} -c \
- '${FILE} "$$0" | ${GREP} -q text && \
+ '${FILE_CMD} "$$0" | ${GREP} -q text && \
${REINPLACE_CMD} -i "" -e "s/
$$//" "$$0"' {} \;
do-build:
Index: games/quake-source/Makefile
===================================================================
RCS file: /home/ncvs/ports/games/quake-source/Makefile,v
retrieving revision 1.9
diff -u -u -r1.9 Makefile
--- games/quake-source/Makefile 14 Mar 2011 16:47:43 -0000 1.9
+++ games/quake-source/Makefile 1 Mar 2012 12:12:57 -0000
@@ -38,7 +38,7 @@
.endif
pre-patch:
- @${FIND} ${WRKSRC} -type f | ${XARGS} ${FILE} | \
+ @${FIND} ${WRKSRC} -type f | ${XARGS} ${FILE_CMD} | \
${GREP} 'CRLF' | ${SED} -e 's/:.*//' | \
${XARGS} ${REINPLACE_CMD} -i "" -e "s/`${PRINTF} '\r'`$$//"
Index: games/quake3-data/Makefile.include
===================================================================
RCS file: /home/ncvs/ports/games/quake3-data/Makefile.include,v
retrieving revision 1.4
diff -u -u -r1.4 Makefile.include
--- games/quake3-data/Makefile.include 20 Mar 2011 21:43:38 -0000 1.4
+++ games/quake3-data/Makefile.include 1 Mar 2012 12:05:16 -0000
@@ -25,7 +25,7 @@
. else
pre-patch:
@${FIND} ${WRKDIR} -type f -print0 | \
- ${XARGS} -0 ${FILE} | ${GREP} 'CRLF' | \
+ ${XARGS} -0 ${FILE_CMD} | ${GREP} 'CRLF' | \
${SED} -e "s/:.*//" | ${SED} -e 's/ /\\ /g' | \
${XARGS} ${REINPLACE_CMD} -i "" -e "s/`${PRINTF} '\r'`$$//"
. endif
Index: science/afni/Makefile
===================================================================
RCS file: /home/ncvs/ports/science/afni/Makefile,v
retrieving revision 1.23
diff -u -u -r1.23 Makefile
--- science/afni/Makefile 2 May 2011 12:44:49 -0000 1.23
+++ science/afni/Makefile 1 Mar 2012 11:51:41 -0000
@@ -104,7 +104,7 @@
${MV} ${INSTALL_WRKSRC}/README* \
${STAGE}/doc
${MV} ${INSTALL_WRKSRC}/abut ${INSTALL_WRKSRC}/afni_abut
- for binary in `${FILE} ${INSTALL_WRKSRC}/* | fgrep 'ELF' | ${AWK} -F ':' ' { print $$1 }'` ; do \
+ for binary in `${FILE_CMD} ${INSTALL_WRKSRC}/* | fgrep 'ELF' | ${AWK} -F ':' ' { print $$1 }'` ; do \
${MV} $${binary} ${STAGE}/bin ; \
done
${MV} ${INSTALL_WRKSRC}/* \
Index: sysutils/daemontools/Makefile
===================================================================
RCS file: /home/ncvs/ports/sysutils/daemontools/Makefile,v
retrieving revision 1.35
diff -u -u -r1.35 Makefile
--- sysutils/daemontools/Makefile 28 Feb 2012 17:23:51 -0000 1.35
+++ sysutils/daemontools/Makefile 1 Mar 2012 12:13:04 -0000
@@ -84,7 +84,7 @@
do-install:
(while read cmd; do \
- if ${FILE} ${WRKSRC}/$$cmd | ${GREP} -q "shell script"; then \
+ if ${FILE_CMD} ${WRKSRC}/$$cmd | ${GREP} -q "shell script"; then \
${INSTALL_SCRIPT} ${WRKSRC}/$$cmd ${PREFIX}/bin; \
else \
${INSTALL_PROGRAM} ${WRKSRC}/$$cmd ${PREFIX}/bin; \
--- FILE_CMD.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list