From owner-freebsd-python@FreeBSD.ORG Wed Oct 3 13:01:50 2012 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8280D1065673 for ; Wed, 3 Oct 2012 13:01:50 +0000 (UTC) (envelope-from c.kworr@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 527BF8FC15 for ; Wed, 3 Oct 2012 13:01:49 +0000 (UTC) Received: by pbbrp8 with SMTP id rp8so11358304pbb.13 for ; Wed, 03 Oct 2012 06:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=+V8sxt7SnM/kp4YfXRnSxZy5jzhdME4Vei9+imlwc8k=; b=Z/eoH/k1jPOFgmi3+nHJyo079CXaHK4nFba7ODAk6/5nF4+vXUBciPY2M8yNwMLOU2 F9LSMLyzFydWyGNCbvRedVtzUfafzDFiAUyw5RYWlYhziWdAGnXAMJFyr6WFEXRTdhuF cerr6q5RfSNeic853Io+gJrTCQ3F0dWKtOxIiD8PyfESVSm7lF4hEa20C5JDK6KeuRjj FKibywEwIfBH9J+chkVZrWMwuHY5c821F4j0wnz5JdMvWTeFHZCgLBt6OfvrCZnoYtHr 0G7DFMbVfu/WL621KlAGN8lM+grQQAqTEGy0+sDzDItK9F4bP3pICEt0VqJgLmwdeM+B XZfQ== Received: by 10.68.232.163 with SMTP id tp3mr12791657pbc.44.1349269303540; Wed, 03 Oct 2012 06:01:43 -0700 (PDT) Received: from [192.168.1.132] (mau.donbass.com. [92.242.127.250]) by mx.google.com with ESMTPS id pw2sm935200pbb.59.2012.10.03.06.01.41 (version=SSLv3 cipher=OTHER); Wed, 03 Oct 2012 06:01:42 -0700 (PDT) Message-ID: <506C3733.7000903@gmail.com> Date: Wed, 03 Oct 2012 16:01:39 +0300 From: Volodymyr Kostyrko User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120924 Thunderbird/15.0.1 MIME-Version: 1.0 To: Ruslan Mahmatkhanov References: <506C1F7F.9020405@gmail.com> <506C2B80.70204@yandex.ru> In-Reply-To: <506C2B80.70204@yandex.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-python@FreeBSD.org Subject: Re: py-distribute update leftover X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Oct 2012 13:01:50 -0000 03.10.2012 15:11, Ruslan Mahmatkhanov wrote: >> Recent py-ditribute update doesn't update easy_install.pth on python2.7: >> >> ===>>> The following actions were performed: >> Re-installation of py27-distribute-0.6.28 >> >> # cd /usr/local/lib/python2.7/site-packages/ >> # cat easy-install.pth >> import sys; sys.__plen = len(sys.path) >> ./distribute-0.6.27-py2.7.egg >> ./Pyrseas-0.5.0-py2.7.egg >> ./Babel-0.9.6-py2.7.egg >> ./Genshi-0.6-py2.7.egg >> ./Pygments-1.5-py2.7.egg >> ./Trac-0.12.3-py2.7.egg >> ./hg_git-0.3.3-py2.7.egg >> ./graphviz-0.7.4-py2.7.egg >> ./TracTocMacro-11.0.0.3-py2.7.egg >> ./pytz-2012f-py2.7.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) >> >> And a new file was created: >> >> # cat easy-install.pth.dist >> import sys; sys.__plen = len(sys.path) >> ./distribute-0.6.28-py2.7.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) > > It's in pkg-plist logic: > """ > %%PYTHON_SITELIBDIR%%/easy-install.pth.dist > @exec if [ ! -f %B/easy-install.pth ]; then cp %B/%f > %B/easy-install.pth; fi > """ > > easy-install.pth.dist is always installed, and it will be only copied to > easy-install.pth if there is no one already. > > What about easy-install.pth contents is not updated - I need an testing > environment. Would you describe the steps you did to stick with > distribute instead of setuptools and I'll try to reproduce? I patched bsd.python.mk like this: @@ -431,7 +431,7 @@ # setuptools support .if defined(USE_PYDISTUTILS) && ${USE_PYDISTUTILS} == "easy_install" -.if ${PYTHON_SUFFIX} < 30 +.if ${PYTHON_SUFFIX} < 30 && !defined(USE_DISTRIBUTE) BUILD_DEPENDS+= ${PYEASYINSTALL_CMD}:${PORTSDIR}/devel/py-setuptools RUN_DEPENDS+= ${PYEASYINSTALL_CMD}:${PORTSDIR}/devel/py-setuptools .else And USE_DISTRIBUTE is mentioned in environment. I needed this as one of the listed packages, Pyrseas, refuses to work with setuptools. I haven't submitted it yet but it can be found on redports: https://redports.org/browser/kworr/databases/py-Pyrseas Minimal proof would be hg-git. I just rechecked the steps to reproduce this: 0. Cleaning up (dunno what that thing about easy_install means, it can be irrelevant): # pkg_delete py27-distribute-0.6.28 py27-hg-git-0.3.3 pkg_delete: file '/usr/local/bin/easy_install' doesn't exist pkg_delete: couldn't entirely delete package `py27-distribute-0.6.28' (perhaps the packing list is incorrectly specified?) # cat /usr/local/lib/python2.7/site-packages/easy-install.pth import sys; sys.__plen = len(sys.path) ./distribute-0.6.27-py2.7.egg ./hg_git-0.3.3-py2.7.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) # rm /usr/local/lib/python2.7/site-packages/easy-install.pth # ls /usr/local/lib/python2.7/site-packages | cat README drv_libxml2.py drv_libxml2.pyc drv_libxml2.pyo dulwich dulwich-0.8.5-py2.7.egg-info easy-install.pth hgext libxml2.py libxml2.pyc libxml2.pyo libxml2mod.a libxml2mod.la libxml2mod.so mercurial mercurial-2.3-py2.7.egg-info xcbgen 1. Install older py-distribute: # cd /usr/ports/devel/py-distribute # svn up -r301510 # make install clean 2. Install hg-git: # cd /usr/ports/devel/hg-git # make install clean 3. Update py-distribute: # cd /usr/ports/devel/py-distribute # svn up # make deinstall reinstall clean ..... /bin/cp /usr/local/lib/python2.7/site-packages/easy-install.pth /usr/local/lib/python2.7/site-packages/easy-install.pth.dist PKG_PREFIX=/usr/local /bin/sh /tmp/ports/usr/ports/devel/py-distribute/work/pkg-install py27-distribute-0.6.28 POST-INSTALL if [ -f /usr/ports/devel/py-distribute/pkg-message ]; then /bin/cat /usr/ports/devel/py-distribute/pkg-message; fi ===> Registering installation for py27-distribute-0.6.28 Voila: we have easy-install.pth: import sys; sys.__plen = len(sys.path) ./distribute-0.6.27-py2.7.egg ./hg_git-0.3.3-py2.7.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) And easy-install.pth.dist: import sys; sys.__plen = len(sys.path) ./distribute-0.6.28-py2.7.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) PS: I'm also using unegg patch. PPS: This is the only bad thing in switching to py-distribute - everything else works: trac, viewvc, others... -- Sphinx of black quartz, judge my vow.