pkgsrc-Users archive

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

Re: ${PYPKGPREFIX}- for package names (and wip/py-buildbot)



On Tue, 14 Jul 2009, Greg Troxel wrote:
> Your issue is one I've encountered and is a bug/not-yet-implemented
> feature in pkg_chk, make replace or pkg_rolling-replace.  As an example,
> there is a package py25-foo installed, with the default python version
> set to 26.  pkg_chk reports that this package is out of date, perhaps
> because 25/26 or perhaps because it's been updated (on the package
> version side).  Then pkg_rolling-replace calls 'make replace', and it
> finds PKGPATH from the installed package, and builds py26-foo, and when
> it tries to deinstall py26-foo fails because it wasn't ever there.

I have the following patch in pkg_rolling-replace.  It's obviously
not the right thing, but it has worked well enough to allow pkg_rr to
replace both py24-foo and py25-foo.  The right thing, I think, would be
for the binary package (and the pkg db entry for an installed package)
to have a list of variables that must be set at build time to create the
package, and for "make replace" to pay attention to that.

--apb (Alan Barrett)

Index: pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh
===================================================================
--- pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh   17 Jun 2009 
08:12:18 -0000      1.21
+++ pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh   8 Jul 2009 
18:40:16 -0000
@@ -380,13 +453,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 PYTHON_VESION_DEFAULT if necessary
+    MAKE_SET_VARS=''
+    case "$pkg" in
+    py25-*)    MAKE_SET_VARS='PYTHON_VERSION_DEFAULT=25' ;;
+    py24-*)    MAKE_SET_VARS='PYTHON_VERSION_DEFAULT=24' ;;
+    esac
+
     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][^-]*$//')
@@ -407,7 +487,8 @@
     # Do make replace, with clean before, and package and clean afterwards.
     echo "${OPI} Replacing $(${PKG_INFO} -e $pkg)"
     fail=
-    cmd="cd \"$PKGSRCDIR/$pkgdir\" && ${MAKE} clean && ${MAKE} replace || 
fail=1"
+    cmd="cd \"$PKGSRCDIR/$pkgdir\" && ${MAKE} ${MAKE_SET_VARS} clean \
+        && ${MAKE} ${MAKE_SET_VARS} replace || fail=1"
     if [ -n "$opt_n" ]; then
        echo "${OPI} Would run: $cmd"
     else
@@ -425,7 +506,7 @@
     # If -r not given, make a binary package.
     if [ -z "$opt_r" ]; 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" ]; then
            echo "${OPI} Would run: $cmd"
        else
@@ -435,7 +516,8 @@
     fi
     # Clean
     if [ -z "$opt_n" ]; then
-       ${MAKE} clean || abort "'make clean' failed for package $pkg."
+       ${MAKE} ${MAKE_SET_VARS} clean \
+       || abort "'make clean' failed for package $pkg."
     fi
 
     sleep 1


Home | Main Index | Thread Index | Old Index