ports/159962: [PATCH] Mk/bsd.python.Mk: prevent polluting filesystem with easy_install
Ruslan Mahmatkhanov
cvs-src at yandex.ru
Sun Aug 21 09:50:06 UTC 2011
>Number: 159962
>Category: ports
>Synopsis: [PATCH] Mk/bsd.python.Mk: prevent polluting filesystem with easy_install
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Aug 21 09:50:05 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Ruslan Mahmatkhanov
>Release: 9.0-BETA1
>Organization:
>Environment:
9.0-BETA1 i386
>Description:
I'm working on update to net-mgmt/py-snmp4 and i faced with interesting issue with easy_install. Right now we have -N switch in our PYEASYINSTALL_INSTALLARGS, that prevents checking for dependencies that set in distribution's setup.py with requires() calls. But the same thing should be applied to PYEASYINSTALL_UNINSTALLARGS, because the deps checking happens on this stage too and effectively polluting filesystem. See this buildlogs:
With current Mk/bsd.python.mk:
http://happy-nation.by.ru/ports/tb/8.2/py27-snmp4-4.1.16c-leaving-files-after-deinstall.log
With patched Mk.bsd.python.mk:
http://happy-nation.by.ru/ports/tb/8.2/py27-snmp4-4.1.16c.log
There is the patch to net-mgmt/py-snmp4 which let you reproduce the problem:
http://happy-nation.by.ru/ports/py-snmp4-4.1.16c.diff.txt
As you can see, at deinstall it fetches and installs pyasn1-0.0.13-py2.7.egg into PYTHON_SITELIBDIR (i checked this also in my live system - this file isn't created on build stage when requires() run, but on deinstall stage).
Technically, we can avoid this on port level with two options:
1. Define PYEASYINSTALL_UNINSTALLARGS= -q -N in port's Makefile
2. Patch setup.py to eliminate all the requires() calls.
3. Define dependencies set in RUN_DEPENDS also in BUILD_DEPENDS,
so the port will find it on requires() checks, but this is wrong
logically - we actually need this dependency only on run-time.
So, i'd prefer to apply this patch to bsd.python.mk
PS. We also may add "-H None" or "--allow-hosts=None" to prevent it download and install anything, as suggested in setuptools manual:
http://peak.telecommunity.com/DevCenter/EasyInstall
but this may be overkill.
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
--- bsd.python.mk.orig 2011-08-21 13:23:01.000000000 +0400
+++ bsd.python.mk 2011-08-21 13:23:20.000000000 +0400
@@ -482,7 +482,7 @@
-d ${PYEASYINSTALL_SITELIBDIR} \
-s ${PYEASYINSTALL_BINDIR} \
${PYDISTUTILS_PKGNAME}==${PYDISTUTILS_PKGVERSION}
-PYEASYINSTALL_UNINSTALLARGS?= -q -m -S ${PYTHON_SITELIBDIR} \
+PYEASYINSTALL_UNINSTALLARGS?= -q -N -m -S ${PYTHON_SITELIBDIR} \
-d ${PYEASYINSTALL_SITELIBDIR} \
-s ${PYEASYINSTALL_BINDIR} \
${PYDISTUTILS_PKGNAME}==${PYDISTUTILS_PKGVERSION}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list