pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_rolling-replace 0.23: Pass PKGNAME_REQD t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3142bf312134
branches:  trunk
changeset: 583487:3142bf312134
user:      gdt <gdt%pkgsrc.org@localhost>
date:      Mon Dec 20 15:39:09 2010 +0000

description:
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@.

diffstat:

 pkgtools/pkg_rolling-replace/Makefile                     |   4 +-
 pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh |  23 +++++++++-----
 2 files changed, 17 insertions(+), 10 deletions(-)

diffs (86 lines):

diff -r a1b6eff4e90b -r 3142bf312134 pkgtools/pkg_rolling-replace/Makefile
--- a/pkgtools/pkg_rolling-replace/Makefile     Mon Dec 20 15:24:24 2010 +0000
+++ b/pkgtools/pkg_rolling-replace/Makefile     Mon Dec 20 15:39:09 2010 +0000
@@ -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 -r a1b6eff4e90b -r 3142bf312134 pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh
--- a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh Mon Dec 20 15:24:24 2010 +0000
+++ b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh Mon Dec 20 15:39:09 2010 +0000
@@ -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 @@
     # 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 @@
     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 @@
                    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 @@
     # 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 @@
     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



Home | Main Index | Thread Index | Old Index