ports/158888: [patch] devel/ccache: relax EXTRA_COMPILERS

Pan Tsu inyaoo at gmail.com
Thu Jul 14 12:10:10 UTC 2011


>Number:         158888
>Category:       ports
>Synopsis:       [patch] devel/ccache: relax EXTRA_COMPILERS
>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:   Thu Jul 14 12:10:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Pan Tsu
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
- EXTRA_COMPILERS = basegcc baseg++ (unchanged for more than a year)
- basegcc & baseg++ are in PATH but not in /usr/bin or LOCALBASE/bin
- cc & c++ are configurable symlinks, just after ccache in PATH
>Description:
Before ccache-update-links was added the port advertised EXTRA_COMPILERS
make/env variable and didn't apply any checks to its value. As the
changes to them are not mentioned in either commit log or UPDATING relax
checks to not break valid user configurations.

- add every known compiler from PATH[1], i.e. do not hardcode search path
- restore EXTRA_COMPILERS to the list of known compilers[2]

[1] a user (root in this case) is responsible for setting safe PATH
[2] as it can be replaced by CCACHE_COMPILERS defined in make.conf
    EXTRA_COMPILERS can be phased out *with* an entry in UPDATING
>How-To-Repeat:
>Fix:
--- a.diff begins here ---
Index: devel/ccache/Makefile
===================================================================
RCS file: /a/.cvsup/ports/devel/ccache/Makefile,v
retrieving revision 1.62
diff -u -p -r1.62 Makefile
--- devel/ccache/Makefile	11 Jun 2011 21:10:12 -0000	1.62
+++ devel/ccache/Makefile	14 Jul 2011 11:27:00 -0000
@@ -35,6 +35,7 @@ CCACHE_COMPILERS+=	icc icpc
 GNU_COMPILERS+=		34 42 43 44 45 46
 CCACHE_COMPILERS+=	cc c++ gcc g++ ${GNU_COMPILERS:S|^|gcc|} ${GNU_COMPILERS:S|^|g++|}
 CCACHE_COMPILERS+=	clang clang++ llvm-gcc llvm-c++ llvm-g++
+CCACHE_COMPILERS+=	${EXTRA_COMPILERS}
 SUB_LIST+=	CCACHE_COMPILERS="${CCACHE_COMPILERS}" \
 		CCLINKDIR="${CCLINKDIR}" \
 		ICCPREFIX="${LOCALBASE}/intel_cc_80/bin" \
Index: devel/ccache/files/ccache-update-links.sh.in
===================================================================
RCS file: /a/.cvsup/ports/devel/ccache/files/ccache-update-links.sh.in,v
retrieving revision 1.1
diff -u -p -r1.1 ccache-update-links.sh.in
--- devel/ccache/files/ccache-update-links.sh.in	29 Mar 2011 14:15:03 -0000	1.1
+++ devel/ccache/files/ccache-update-links.sh.in	14 Jul 2011 11:29:49 -0000
@@ -32,7 +32,7 @@ esac
 # create compiler links
 for comp in ${CCACHE_COMPILERS}
 do
-	if [ -f "${PREFIX}/bin/${comp}" ] || [ -f "/usr/bin/${comp}" ]; then
+	if command -v "${comp}" >/dev/null; then
 		if [ ! -L "${PREFIX}/${CCLINKDIR}/${comp}" ]; then
 			[ "$1" = "-v" ] && echo "create symlink for ${comp}"
         		ln -sf ${PREFIX}/bin/ccache ${PREFIX}/${CCLINKDIR}/${comp}
--- a.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list