aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authorperky <perky@FreeBSD.org>2004-12-06 13:28:34 +0800
committerperky <perky@FreeBSD.org>2004-12-06 13:28:34 +0800
commit9c606e4370acc4d05c3030a8f8017d50f554a372 (patch)
treed254e4a7b034919afc655c8f0dae47261cbd823a /lang
parentc591bebabfdf65bb52c96bfd3030efab6fd8fa8e (diff)
downloadfreebsd-ports-gnome-9c606e4370acc4d05c3030a8f8017d50f554a372.tar.gz
freebsd-ports-gnome-9c606e4370acc4d05c3030a8f8017d50f554a372.tar.zst
freebsd-ports-gnome-9c606e4370acc4d05c3030a8f8017d50f554a372.zip
Add new utility target named 'upgrade-site-packages' to upgrade
site-packages which was built on previous version of python.
Diffstat (limited to 'lang')
-rw-r--r--lang/python/Makefile22
-rw-r--r--lang/python24/Makefile22
2 files changed, 44 insertions, 0 deletions
diff --git a/lang/python/Makefile b/lang/python/Makefile
index 44835915da53..0fafbcb85066 100644
--- a/lang/python/Makefile
+++ b/lang/python/Makefile
@@ -188,4 +188,26 @@ post-install:
@${CAT} ${PKGMESSAGE}
+PORTUPGRADE?= ${LOCALBASE}/sbin/portupgrade
+PKG_WHICH?= ${LOCALBASE}/sbin/pkg_which
+upgrade-site-packages:
+ @if [ -x ${PORTUPGRADE} ]; then \
+ for ver in 2.1 2.2 2.3; do \
+ if [ -d ${PREFIX}/lib/python$$ver ]; then \
+ UPD=`${FIND} ${PREFIX}/lib/python$$ver \
+ -type f -print0 | \
+ ${XARGS} -0 ${PKG_WHICH} | \
+ ${GREP} -Fv '?' | \
+ ${GREP} -v '^python-2' | \
+ ${SORT} -u`; \
+ if [ "$$UPD" ]; then \
+ ${PORTUPGRADE} -f $$UPD; \
+ fi; \
+ fi; \
+ done; \
+ else \
+ ${ECHO_MSG} "Please install sysutils/portupgrade."; \
+ ${FALSE}; \
+ fi
+
.include <bsd.port.post.mk>
diff --git a/lang/python24/Makefile b/lang/python24/Makefile
index 44835915da53..0fafbcb85066 100644
--- a/lang/python24/Makefile
+++ b/lang/python24/Makefile
@@ -188,4 +188,26 @@ post-install:
@${CAT} ${PKGMESSAGE}
+PORTUPGRADE?= ${LOCALBASE}/sbin/portupgrade
+PKG_WHICH?= ${LOCALBASE}/sbin/pkg_which
+upgrade-site-packages:
+ @if [ -x ${PORTUPGRADE} ]; then \
+ for ver in 2.1 2.2 2.3; do \
+ if [ -d ${PREFIX}/lib/python$$ver ]; then \
+ UPD=`${FIND} ${PREFIX}/lib/python$$ver \
+ -type f -print0 | \
+ ${XARGS} -0 ${PKG_WHICH} | \
+ ${GREP} -Fv '?' | \
+ ${GREP} -v '^python-2' | \
+ ${SORT} -u`; \
+ if [ "$$UPD" ]; then \
+ ${PORTUPGRADE} -f $$UPD; \
+ fi; \
+ fi; \
+ done; \
+ else \
+ ${ECHO_MSG} "Please install sysutils/portupgrade."; \
+ ${FALSE}; \
+ fi
+
.include <bsd.port.post.mk>