aboutsummaryrefslogtreecommitdiff
path: root/lang/python/Makefile
diff options
context:
space:
mode:
authorHye-Shik Chang <perky@FreeBSD.org>2004-12-06 05:28:34 +0000
committerHye-Shik Chang <perky@FreeBSD.org>2004-12-06 05:28:34 +0000
commit2339b743064eadf32acef4b8028d0225f5930205 (patch)
tree3509188a2f99c3d0f5041318966cb8011cd187f0 /lang/python/Makefile
parent7e00f5ec93dd5db2bcb234796dfe160f55d414b7 (diff)
downloadports-2339b743064eadf32acef4b8028d0225f5930205.tar.gz
ports-2339b743064eadf32acef4b8028d0225f5930205.zip
Add new utility target named 'upgrade-site-packages' to upgrade
site-packages which was built on previous version of python.
Notes
Notes: svn path=/head/; revision=123279
Diffstat (limited to 'lang/python/Makefile')
-rw-r--r--lang/python/Makefile22
1 files changed, 22 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>