[PATCH] devel/py-simplejson: doesn't delete/add its own entry from/to easy-install.pth

Nicola Vitale nivit at email.it
Thu Jan 25 21:39:01 UTC 2007


>Submitter-Id:	current-users
>Originator:	Nicola Vitale
>Organization:	
>Confidential:	no 
>Synopsis:	[PATCH] devel/py-simplejson: doesn't delete/add its own entry from/to easy-install.pth
>Severity:	non-critical
>Priority:	low
>Category:	ports 
>Class:		change-request
>Release:	FreeBSD 6.2-STABLE amd64
>Environment:
System: FreeBSD furbetto.domo.sva 6.2-STABLE FreeBSD 6.2-STABLE #2: Sun Jan 21 11:41:41 CET 2007
>Description:

py-simplejson does not delete its own entry from
${PYTHON_SITELIBDIR}/easy-install.pth, when you
remove/unistall the package/port.
Further, it does not register it when you use
pkg_add.

Port maintainer (python at FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:

  [neither py-setuptools nor py-simplejson installed]

root # cd /usr/ports/devel/py-simplejson
root # make package
  [...]
Registering depends: py24-setuptools-0.6c3_1 python24-2.4.3_3.
Creating bzip'd tar ball in '/usr/ports/devel/py-simplejson/py24-simplejson-1.4.tbz'
root # make deinstall
===>  Deinstalling for devel/py-simplejson
===>   Deinstalling py24-simplejson-1.4
root # cd ../py-setuptools
root # make deinstall
===>  Deinstalling for devel/py-setuptools
===>   Deinstalling py24-setuptools-0.6c3_1
pkg_delete: '/usr/local/lib/python2.4/site-packages/easy-install.pth' fails original MD5 checksum - deleted anyway.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
root # make reinstall
  [...]
===>   Registering installation for py24-setuptools-0.6c3_1
root # cd ../py-simplejson
root # pkg_add py24-simplejson-1.4.tbz
root # cat /usr/local/lib/python2.4/site-packages/easy-install.pth 
import sys; sys.__plen = len(sys.path)
./setuptools-0.6c3-py2.4.egg
import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)

  [there is not simplejson and the module is not available]

root # python
Python 2.4.3 (#2, Nov 27 2006, 19:13:07) 
[GCC 3.4.6 [FreeBSD] 20060305] on freebsd6
Type "help", "copyright", "credits" or "license" for more information.
>>> import simplejson
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named simplejson
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> 

>Fix:

--- py24-simplejson-1.4_1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/devel/py-simplejson/Makefile /usr/ports/devel/py-simplejson.fix-1.4_1/Makefile
--- /usr/ports/devel/py-simplejson/Makefile	Mon Nov 27 21:09:54 2006
+++ /usr/ports/devel/py-simplejson.fix-1.4_1/Makefile	Thu Jan 25 21:05:45 2007
@@ -7,6 +7,7 @@
 
 PORTNAME=	simplejson
 PORTVERSION=	1.4
+PORTREVISION=	1
 CATEGORIES=	devel python
 MASTER_SITES=	http://cheeseshop.python.org/packages/source/s/simplejson/
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -19,5 +20,10 @@
 
 USE_PYTHON=	yes
 USE_PYDISTUTILS=	yes
+
+PYSIMPLEJSON_EGG=	${PORTNAME}-${PORTVERSION}-py${PYTHON_VER}.egg
+
+PLIST_SUB+=	PYSIMPLEJSON_EGG=${PYSIMPLEJSON_EGG} \
+		EGG_VER="${PORTNAME}==${PORTVERSION}"
 
 .include <bsd.port.mk>
diff -ruN --exclude=CVS /usr/ports/devel/py-simplejson/pkg-plist /usr/ports/devel/py-simplejson.fix-1.4_1/pkg-plist
--- /usr/ports/devel/py-simplejson/pkg-plist	Thu Sep  7 10:10:45 2006
+++ /usr/ports/devel/py-simplejson.fix-1.4_1/pkg-plist	Thu Jan 25 21:03:01 2007
@@ -1 +1,4 @@
-%%PYTHON_SITELIBDIR%%/simplejson-1.4-py2.4.egg
+ at comment $FreeBSD$
+ at unexec easy_install -q -m -S %D/%%PYTHON_SITELIBDIR%% %%EGG_VER%%
+%%PYTHON_SITELIBDIR%%/%%PYSIMPLEJSON_EGG%%
+ at exec easy_install -q -N -S %D/%%PYTHON_SITELIBDIR%% %%EGG_VER%%
--- py24-simplejson-1.4_1.patch ends here ---



More information about the freebsd-python mailing list