Add new utility target named 'upgrade-site-packages' to upgrade

site-packages which was built on previous version of python.
This commit is contained in:
Hye-Shik Chang 2004-12-06 05:28:34 +00:00
parent 7e00f5ec93
commit 2339b74306
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=123279
2 changed files with 44 additions and 0 deletions

View File

@ -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>

View File

@ -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>