aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authorwxs <wxs@FreeBSD.org>2009-06-11 21:29:23 +0800
committerwxs <wxs@FreeBSD.org>2009-06-11 21:29:23 +0800
commitf7dbc203a6ef398913eea9029602e452be2e0b78 (patch)
tree98b3f0e6fee78389be8f3c982b6e13759923a081 /lang
parent6426af2426ed80d92164a851a10105abacc15cb5 (diff)
downloadfreebsd-ports-gnome-f7dbc203a6ef398913eea9029602e452be2e0b78.tar.gz
freebsd-ports-gnome-f7dbc203a6ef398913eea9029602e452be2e0b78.tar.zst
freebsd-ports-gnome-f7dbc203a6ef398913eea9029602e452be2e0b78.zip
- Add support for portmaster to upgrade-site-packages.
Approved by: miwi
Diffstat (limited to 'lang')
-rw-r--r--lang/python/Makefile22
1 files changed, 18 insertions, 4 deletions
diff --git a/lang/python/Makefile b/lang/python/Makefile
index b9625efee776..77e04b526742 100644
--- a/lang/python/Makefile
+++ b/lang/python/Makefile
@@ -24,8 +24,18 @@ do-install:
@${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
+JOBS= sysctl -n kern.smp.cpus
+XARGS_CMD= ${XARGS} -L 1 -0 -P $$(${JOBS})
+.endif
+
upgrade-site-packages:
@if [ ! -x ${PORTUPGRADE_CMD} ]; then \
${ECHO_MSG} "Please install ports-mgmt/portupgrade."; \
@@ -36,12 +46,16 @@ upgrade-site-packages:
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`; \
if [ "$$UPD" ]; then \
- ${PORTUPGRADE_CMD} -f $$UPD; \
+ if [ -n ${PORTUPGRADE_ARGS} ]; then \
+ ${PORTUPGRADE_CMD} ${PORTUPGRADE_ARGS} -f $$UPD; \
+ else \
+ ${PORTUPGRADE_CMD} -f $$UPD; \
+ fi; \
fi; \
fi; \
done \