On Tue, Jun 09, 2009 at 10:49:21AM -0700, Doug Barton wrote:
> Wesley Shields wrote:
> > wxs         2009-06-09 13:46:03 UTC
> > 
> >   FreeBSD ports repository
> > 
> >   Modified files:
> >     .                    UPDATING 
> >   Log:
> >   - Remove portmaster instructions for python update as they do not work.
> >     I am working on a fix to the upgrade-site-packages target to support
> >     using portmaster.
> 
> If you need any help just let me know.

The problem was not with portmaster, but was with the reliance on
pkg_which.  The attached patch should fit it. I currently have sent it
to itetcu and miwi for review. The biggest downside is that pkg_info can
not take multiple arguments on the command line like pkg_which does, so
we have to use xargs -L 1, which makes things slow compared to using
pkg_which.

If anyone wants to test it out please feel free to do so:

cd /usr/ports/lang/python && make upgrade-site-packages -DUSE_PORTMASTER

But be warned that I have only tested it on one machine so I'm not
responsible if it lights your cat on fire or other bad things.

-- WXS
Index: Makefile
===================================================================
RCS file: /ncvs/ports/lang/python/Makefile,v
retrieving revision 1.161
diff -u -r1.161 Makefile
--- Makefile	31 Jul 2007 16:28:32 -0000	1.161
+++ Makefile	9 Jun 2009 15:43:57 -0000
@@ -24,8 +24,17 @@
 	@${DO_NADA}
 
 # Major upgrade support
-PORTUPGRADE_CMD?=	${LOCALBASE}/sbin/portupgrade
-PKG_WHICH_CMD?=	${LOCALBASE}/sbin/pkg_which
+PORTUPGRADE_CMD=	${LOCALBASE}/sbin/portupgrade
+PKG_WHICH_CMD=	${LOCALBASE}/sbin/pkg_which
+XARGS_CMD=	${XARGS} -0
+
+.if defined(USE_PORTMASTER)
+PORTUPGRADE_CMD=	${LOCALBASE}/sbin/portmaster
+PORTUPGRADE_ARGS=	""
+PKG_WHICH_CMD=	/usr/sbin/pkg_info -qW
+XARGS_CMD=	${XARGS} -L 1 -0
+.endif
+
 upgrade-site-packages:
 	@if [ ! -x ${PORTUPGRADE_CMD} ]; then \
 		${ECHO_MSG} "Please install ports-mgmt/portupgrade."; \
@@ -36,7 +45,7 @@
 		if [ -d ${PREFIX}/lib/python$$ver ]; then \
 			UPD=`${FIND} ${PREFIX}/lib/python$$ver \
 					-type f -print0 | \
-				${XARGS} -0 ${PKG_WHICH_CMD} | \
+				${XARGS_CMD} ${PKG_WHICH_CMD} | \
 				${GREP} -Fv '?' | \
 				${EGREP} -v '^python2?[0-5]?-2' | \
 				${SORT} -u`; \
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to