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<j...@freebsd.org> 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
--- 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
_______________________________________________
freebsd-python@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"

Reply via email to