diff options
author | gdt <gdt> | 2010-12-20 15:39:09 +0000 |
---|---|---|
committer | gdt <gdt> | 2010-12-20 15:39:09 +0000 |
commit | e5e39fd237e898e9dd73103e811727ce90b9b12f (patch) | |
tree | f6f1606d04a1d2b759df072d11d2e633dee2225d | |
parent | ed5c5ea3b07c6e48b11dd114bf3c4ff9cffc7d25 (diff) | |
download | pkgsrc-e5e39fd237e898e9dd73103e811727ce90b9b12f.tar.gz |
0.23: Pass PKGNAME_REQD to make operations.
Set PKGNAME_REQD to give underlying make processes a chance to set
options derived from the package name. For example, the appropriate
version of Python can be derived from the package name (so, when
building py25-foo, use python-2.5, not python-2.6). Specifically,
MAKE_SET_VARS='PKGNAME_REQD=${pkg}-*'
From Alan Barret via pkgsrc-users@.
-rw-r--r-- | pkgtools/pkg_rolling-replace/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh | 23 |
2 files changed, 17 insertions, 10 deletions
diff --git a/pkgtools/pkg_rolling-replace/Makefile b/pkgtools/pkg_rolling-replace/Makefile index 63314cd85a1..bed3f72e17b 100644 --- a/pkgtools/pkg_rolling-replace/Makefile +++ b/pkgtools/pkg_rolling-replace/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.30 2010/12/20 15:24:24 gdt Exp $ +# $NetBSD: Makefile,v 1.31 2010/12/20 15:39:09 gdt Exp $ -DISTNAME= pkg_rolling-replace-0.22 +DISTNAME= pkg_rolling-replace-0.23 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh index f17db7596dd..8c2442bcb2d 100755 --- a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh +++ b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh @@ -1,6 +1,6 @@ #!/bin/sh -# $NetBSD: pkg_rolling-replace.sh,v 1.29 2010/12/20 15:24:24 gdt Exp $ +# $NetBSD: pkg_rolling-replace.sh,v 1.30 2010/12/20 15:39:09 gdt Exp $ #<license> # Copyright (c) 2006 BBN Technologies Corp. All rights reserved. # @@ -448,13 +448,20 @@ while [ -n "$REPLACE_TODO" ]; do # tsorted order and run 'make install' on it. This seems like # such a rare case that the added complexity isn't worth it. + # Set PKGNAME_REQD to give underlying make processes a chance to + # set options derived from the package name. For example, + # the appropriate version of Python can be derived from the + # package name (so, when building py25-foo, use python-2.5, + # not python-2.6). + MAKE_SET_VARS='PKGNAME_REQD=${pkg}-*' + if ! is_member $pkg $DEPENDS_CHECKED; then echo "${OPI} Checking if $pkg has new depends..." OLD_DEPENDS=$(${PKG_INFO} -Nq $pkg | sed 's/-[0-9][^-]*$//') NEW_DEPENDS= cd "$PKGSRCDIR/$pkgdir" - bdeps=$(${MAKE} show-depends VARNAME=BUILD_DEPENDS) - rdeps=$(${MAKE} show-depends) + bdeps=$(${MAKE} ${MAKE_SET_VARS} show-depends VARNAME=BUILD_DEPENDS) + rdeps=$(${MAKE} ${MAKE_SET_VARS} show-depends) for depver in $bdeps $rdeps; do dep=$(echo $depver | sed -e 's/[:[].*$/0/' -e 's/[<>]=/-/' \ -e 's/-[0-9][^-]*$//') @@ -494,7 +501,7 @@ while [ -n "$REPLACE_TODO" ]; do if [ -z "$fail" ]; then if [ -z "$opt_F" ]; then echo "${OPI} Replacing $pkgname" - cmd="${MAKE} clean || fail=1" + cmd="${MAKE} ${MAKE_SET_VARS} clean || fail=1" if [ -n "$opt_n" ]; then echo "${OPI} Would run: $cmd" else @@ -508,10 +515,10 @@ while [ -n "$REPLACE_TODO" ]; do error "'make clean' failed for package $pkg." fi fi - cmd="${MAKE} replace || fail=1" # XXX OLDNAME= support? xmlrpc-c -> xmlrpc-c-ss + cmd="${MAKE} ${MAKE_SET_VARS} replace || fail=1" # XXX OLDNAME= support? xmlrpc-c -> xmlrpc-c-ss else echo "${OPI} Fetching $pkgname" - cmd="${MAKE} fetch depends-fetch || fail=1" + cmd="${MAKE} ${MAKE_SET_VARS} fetch depends-fetch || fail=1" fi fi @@ -539,7 +546,7 @@ while [ -n "$REPLACE_TODO" ]; do # If -r not given, make a binary package. if [ -z "$opt_r" -a -z "$fail" -a -z "$opt_F" ]; then echo "${OPI} Packaging $(${PKG_INFO} -e $pkg)" - cmd="${MAKE} package || fail=1" + cmd="${MAKE} ${MAKE_SET_VARS} package || fail=1" if [ -n "$opt_n" -a -z "$fail" ]; then echo "${OPI} Would run: $cmd" elif [ -z "$fail" ]; then @@ -556,7 +563,7 @@ while [ -n "$REPLACE_TODO" ]; do fi # Clean if [ -z "$opt_n" -a -z "$fail" -a -z "$opt_F" ]; then - cmd="${MAKE} clean || fail=1" + cmd="${MAKE} ${MAKE_SET_VARS} clean || fail=1" if [ -n "$logfile" ]; then eval "$cmd" >&3 2>&3 else |