From owner-freebsd-python@FreeBSD.ORG Wed Jun 13 19:02:07 2012 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E38CB1065817 for ; Wed, 13 Jun 2012 19:02:06 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 140208FC1C for ; Wed, 13 Jun 2012 19:02:04 +0000 (UTC) Received: by lbon10 with SMTP id n10so1864506lbo.13 for ; Wed, 13 Jun 2012 12:02:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:x-gm-message-state; bh=lI1sgXczhdhjVpT/CNwBYfqFh6t65ymchiDNUSeHVxU=; b=SPRd8oh0iB6qafHpjW/lqSYRgk+FifR416A+ujJ72MgraD/lWfb4sr++dGRYcHOsXT tessAWBH6updkvS46YLGnhi3GLvljrIwB0ndePp1lrjnt6Xuey8wONtudYUnc4DR+y1X jiXimXU0vKo7WbHUnCWuaaCApL7hLOknX3Lfham3/BVdS8VWsLYoCy99iW828qWADc5n 6ylBoDdcQUVS5xwAqNdTOOTpn5uWafWsKfdcqe2V3so8Y2igjnQr7tQ1nLWUHNQGpGla hnPsIM1hkepcS6tGy15KfKXB2TaHIk2RkmOQti8va4vWkmlf+05AIafROZVgH09ASl2v ASOw== Received: by 10.152.113.199 with SMTP id ja7mr25383773lab.10.1339614123962; Wed, 13 Jun 2012 12:02:03 -0700 (PDT) Received: from zont-osx.local (ppp95-165-158-211.pppoe.spdop.ru. [95.165.158.211]) by mx.google.com with ESMTPS id i4sm3132926lbg.17.2012.06.13.12.02.02 (version=SSLv3 cipher=OTHER); Wed, 13 Jun 2012 12:02:03 -0700 (PDT) Message-ID: <4FD8E3A8.7020001@zonov.org> Date: Wed, 13 Jun 2012 23:02:00 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: miwi@FreeBSD.org References: <201206121725.03767.jhb@freebsd.org> <20120613215312.5d238750.miwi@FreeBSD.org> <4FD8D5EC.4000409@zonov.org> In-Reply-To: <4FD8D5EC.4000409@zonov.org> Content-Type: multipart/mixed; boundary="------------010408050501040403060806" X-Gm-Message-State: ALoCoQkkjOscO3VRRD5ZtSnqQ3orZWdaXkczmcKVZkkKBC0IIF/epIdEN0I7UWsK+G+A19ioLno4 Cc: John Baldwin , freebsd-python@freebsd.org Subject: Re: Earlier patch to always install python's eggs as unpacked files 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, 13 Jun 2012 19:02:07 -0000 This is a multi-part message in MIME format. --------------010408050501040403060806 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 6/13/12 10:03 PM, Andrey Zonov wrote: > On 6/13/12 5:53 PM, Martin Wilke wrote: >> On Tue, 12 Jun 2012 17:25:03 -0400 >> John Baldwin wrote: >> >>> There was a patch in this post from last year >>> (http://lists.freebsd.org/pipermail/freebsd-python/2011-August/003701.html) >>> >>> to make python packages unpack eggs to avoid problems with shared egg >>> caches and to avoid requiring Internet access during pkg_add. Andrey >>> mentioned doing an exp run with his patch. I don't see the patch >>> committed to bsd.python.mk or any further replies to the thread. We >>> are running into some of these issues using our own packages at my >>> work. Were there any problems with this patch or during it's exp run? >>> >> >> Hi John and Andrey, >> >> I've add that to my todo for next exprun over the weekend. >> >> - Martin >> > > Hi, > > There is a problem with this patch. If you build package for one FreeBSD > version and install package to another, easy_install will fetch sources > and will try to build an egg. I found that during upgrading from 8.2 to > 9.0. > > My suggestion is to replace post-install/pre-deinstall actions to > manually editing easy-install.pth. I mean this code: > > @${ECHO_CMD} "@unexec ${PYEASYINSTALL_CMD} > ${PYEASYINSTALL_UNINSTALLARGS}" \ > > ${TMPPLIST} > @${ECHO_CMD} "@unexec ${RM} -rf > ${PYTHON_SITELIBDIR}/${PYEASYINSTALL_EGG}" >> ${TMPPLIST} > @${ECHO_CMD} "@exec ${SETENV} PYTHONPATH=${PYEASYINSTALL_SITELIBDIR} \ > ${PYEASYINSTALL_CMD} ${PYEASYINSTALL_INSTALLARGS}" \ > >> ${TMPPLIST} > > What do you think? > > PS: I don't really like this solution. > Attached patch works for pymongo. -- Andrey Zonov --------------010408050501040403060806 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="bsd.python.mk.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bsd.python.mk.patch" --- Mk/bsd.python.mk.orig 2011-11-07 16:40:53.000000000 +0400 +++ Mk/bsd.python.mk 2012-06-13 22:48:33.000000000 +0400 @@ -460,7 +460,7 @@ PYDISTUTILS_BUILD_TARGET?= bdist_egg PYDISTUTILS_INSTALL_TARGET?= easy_install -PYDISTUTILS_INSTALLARGS?= -O 1 -N -S ${PYTHON_SITELIBDIR} \ +PYDISTUTILS_INSTALLARGS?= -Z --record ${TMPPLIST}.egg -O 1 -N -S ${PYTHON_SITELIBDIR} \ -d ${PYEASYINSTALL_SITELIBDIR} \ -s ${PYEASYINSTALL_BINDIR} \ ${WRKSRC}/dist/${PYEASYINSTALL_EGG} @@ -496,13 +496,17 @@ add-plist-post: add-plist-easyinstall add-plist-easyinstall: @# @unexec line must be located before any other line while @exec must not. - @${CAT} ${TMPPLIST} > ${TMPPLIST}.pei_tmp - @${ECHO_CMD} "@unexec ${PYEASYINSTALL_CMD} ${PYEASYINSTALL_UNINSTALLARGS}" \ + @${TOUCH} ${TMPPLIST}.egg + @${SED} -i "" -e 's,^${PREFIX}/,,' ${TMPPLIST}.egg + @${GREP} -v "^${PYTHON_SITELIBDIR:S,${PREFIX}/,,}/${PYEASYINSTALL_EGG}$$" ${TMPPLIST} \ + > ${TMPPLIST}.pei_tmp || ${TRUE} + @${ECHO_CMD} "@unexec ${RM} -f ${PYTHON_SITELIBDIR}/${PYEASYINSTALL_EGG}.pth" \ > ${TMPPLIST} - @${CAT} ${TMPPLIST}.pei_tmp >> ${TMPPLIST} - @${ECHO_CMD} "@exec ${SETENV} PYTHONPATH=${PYEASYINSTALL_SITELIBDIR} \ - ${PYEASYINSTALL_CMD} ${PYEASYINSTALL_INSTALLARGS}" \ + @${SORT} -ru ${TMPPLIST}.egg ${TMPPLIST}.pei_tmp >> ${TMPPLIST} + @${ECHO_CMD} "@unexec ${RM} -rf ${PYTHON_SITELIBDIR}/${PYEASYINSTALL_EGG}" \ >> ${TMPPLIST} + @${ECHO_CMD} "@exec ${ECHO_CMD} './${PYEASYINSTALL_EGG}' \ + >> ${PYTHON_SITELIBDIR}/${PYEASYINSTALL_EGG}.pth" >> ${TMPPLIST} .endif # defined(USE_PYDISTUTILS) && ${USE_PYDISTUTILS} == "easy_install" # distutils support --------------010408050501040403060806--