diff options
author | Hye-Shik Chang <perky@FreeBSD.org> | 2004-12-06 13:28:34 +0800 |
---|---|---|
committer | Hye-Shik Chang <perky@FreeBSD.org> | 2004-12-06 13:28:34 +0800 |
commit | 2339b743064eadf32acef4b8028d0225f5930205 (patch) | |
tree | 3509188a2f99c3d0f5041318966cb8011cd187f0 /lang/python | |
parent | 7e00f5ec93dd5db2bcb234796dfe160f55d414b7 (diff) | |
download | freebsd-ports-gnome-2339b743064eadf32acef4b8028d0225f5930205.tar.gz freebsd-ports-gnome-2339b743064eadf32acef4b8028d0225f5930205.tar.zst freebsd-ports-gnome-2339b743064eadf32acef4b8028d0225f5930205.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/python')
-rw-r--r-- | lang/python/Makefile | 22 |
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> |