From owner-freebsd-python@FreeBSD.ORG Sat Apr 13 17:58:57 2013 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C0496D9A for ; Sat, 13 Apr 2013 17:58:57 +0000 (UTC) (envelope-from bsd-src@helfman.org) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx1.freebsd.org (Postfix) with ESMTP id 822A0E40 for ; Sat, 13 Apr 2013 17:58:57 +0000 (UTC) Received: by mail-ve0-f174.google.com with SMTP id jz10so3178290veb.19 for ; Sat, 13 Apr 2013 10:58:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=Uni0BOX8ZXSaUjpgSZmOy7TkCrx/jGjPTta22EzRRQ0=; b=XgSKxDtS7hAWHE4Ipn6lI9876Y5J2ddBsCpc/XsL4DUck4EsiAuuFt3Wl4dtxpt/Vq XSOk0uitGBOzs/D9NP71up9oF/WgZFmbp71WO//4bl2BLJl+trR3C9wDvpK0fyhm7aYY 4HEjQE6qdYDYvAllBJsfnYtm/2ANj5IIU6hYIyKqNgXk30EBNQzkBmnb2ZnTFt8glD1i HEGw5vqzM2cSRcmn7X63XbyfMHyrvmzrhZir1y5n2J4fCcuYJV0ePhhjsXU5ZXOa2lc5 vZCZzit1vyxseuloZMt6rkVK8NdFZUBBNmJf8bfT/fmXxVQyBoVIzz4r9T3Vf+xaF6fz VQ1A== MIME-Version: 1.0 X-Received: by 10.52.179.105 with SMTP id df9mr10271617vdc.49.1365875936520; Sat, 13 Apr 2013 10:58:56 -0700 (PDT) Sender: bsd-src@helfman.org Received: by 10.58.34.200 with HTTP; Sat, 13 Apr 2013 10:58:56 -0700 (PDT) In-Reply-To: <506C2B80.70204@yandex.ru> References: <506C1F7F.9020405@gmail.com> <506C2B80.70204@yandex.ru> Date: Sat, 13 Apr 2013 10:58:56 -0700 X-Google-Sender-Auth: JBGvN062qqWusKP4TSfLnp3rYNQ Message-ID: Subject: Re: py-distribute update leftover From: Jason Helfman To: Ruslan Mahmatkhanov X-Gm-Message-State: ALoCoQkJl3SUBl3yqm9OcOWl4nMLrCv1kTXYrTywrr42/+vpFvhpGvSFzNTvvaDoo9OIGeg6TAmM Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Volodymyr Kostyrko , freebsd-python@freebsd.org X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Apr 2013 17:58:57 -0000 On Wed, Oct 3, 2012 at 5:11 AM, Ruslan Mahmatkhanov wrote: > Hello, > > Volodymyr Kostyrko wrote on 03.10.2012 15:20: > > Hello. >> >> 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? > > -- > Regards, > Ruslan In porting a new application, I found the logic in the pkg-plist, after investigation with a fellow developer (db@) to potentially not be the best path. The application I ported updates easy-install.pth, as I assume other py- packages do, much like installing openjdk6 would register the jvm. So this file will always differ, and never be removed. @unexec if cmp -s %B/easy-install.pth %B/easy-install.pth.dist; then rm %B/easy-install.pth; fi Unless, of course, on de-installation if the egg would be de-registered from easy-install.pth through the Mk framework. On a clean system, all packages would register, and then de-register on de-installation and then the file would be safely removed. https://redports.org/buildarchive/20130412222501-42749/ I would appreciate any feedback. Thanks! -jgh -- Jason Helfman | FreeBSD Committer jgh@FreeBSD.org | http://people.freebsd.org/~jgh | The Power to Serve