site.py woes

Hye-Shik Chang perky at FreeBSD.org
Mon Nov 19 18:22:28 PST 2007


On Sat, Nov 17, 2007 at 08:26:16PM +0100, Pav Lucistnik wrote:
> Hi,
> 
> recently a lot of python ports developed a leftover site.py, and
> pointyhat scripts does not like that.
> 
> I checked into the easy_install source, and it seems it will copy
> site.py from it's .egg subdir to PYTHON_SITELIBDIR on every install.
> 
> Since I don't see a way to force it to delete it on deinstall, my
> suggestion is as follows - what if we plant site.py into
> PYTHON_SITELIBDIR in py-setuptools post-install, and delete it on it's
> deinstall?

I couldn't find a neat way to force not to install the file, either.
The idea sounds good to me.  py-setuptools tries to touch the file
for various purposes, it'll be quite hard to fix for every time
new usage is found.  Thanks for the investigation.  Here's a patch.

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/devel/py-setuptools/Makefile,v
retrieving revision 1.15
diff -u -r1.15 Makefile
--- Makefile	10 Sep 2007 00:09:34 -0000	1.15
+++ Makefile	20 Nov 2007 02:20:32 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	setuptools
 PORTVERSION=	0.6c7
+PORTREVISION=	1
 CATEGORIES=	devel python
 MASTER_SITES=	${MASTER_SITE_CHEESESHOP}
 MASTER_SITE_SUBDIR=	source/s/setuptools
@@ -32,6 +33,12 @@
 .endif
 
 post-install:
+	${INSTALL_DATA} ${WRKSRC}/site.py ${PYTHON_SITELIBDIR}
+.for opt in -Qold -O
+	${PYTHON_CMD} ${opt} -m compileall -l -x \
+		'^[^s][^i]?[^t]?[^e]?[^.][^p][^y]$$' ${PYTHON_SITELIBDIR}
+.endfor
+
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
 	${INSTALL_DATA} ${WRKSRC}/*.txt ${DOCSDIR}
Index: pkg-plist
===================================================================
RCS file: /home/pcvs/ports/devel/py-setuptools/pkg-plist,v
retrieving revision 1.10
diff -u -r1.10 pkg-plist
--- pkg-plist	1 Sep 2007 22:12:58 -0000	1.10
+++ pkg-plist	20 Nov 2007 02:20:33 -0000
@@ -3,6 +3,9 @@
 bin/easy_install-%%PYVER%%
 %%PYTHON_SITELIBDIR%%/easy-install.pth
 %%PYTHON_SITELIBDIR%%/setuptools.pth
+%%PYTHON_SITELIBDIR%%/site.py
+%%PYTHON_SITELIBDIR%%/site.pyc
+%%PYTHON_SITELIBDIR%%/site.pyo
 %%PYTHON_CURRENT%%%%PYTHON_SITELIBDIR%%/setuptools-%%VERSION%%-py%%PYVER%%.egg
 %%PYTHON_OLD%%%%PYTHON_SITELIBDIR%%/setuptools-%%VERSION%%-py%%PYVER%%.egg/EGG-INFO/PKG-INFO
 %%PYTHON_OLD%%%%PYTHON_SITELIBDIR%%/setuptools-%%VERSION%%-py%%PYVER%%.egg/EGG-INFO/SOURCES.txt


Hye-Shik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-python/attachments/20071120/a80401a3/attachment.pgp


More information about the freebsd-python mailing list