Date: Thu, 26 Sep 2013 17:54:54 -0300 From: William Grzybowski <william88@gmail.com> To: Marcus von Appen <mva@freebsd.org> Cc: "svn-ports-head@freebsd.org" <svn-ports-head@freebsd.org>, "svn-ports-all@freebsd.org" <svn-ports-all@freebsd.org>, ports-committers <ports-committers@freebsd.org> Subject: Re: svn commit: r328403 - head/Mk Message-ID: <CAHtVNLPvWEO7bU1bUmc=gawB4HdytaTOosBR31V9JPBM_DYuyw@mail.gmail.com> In-Reply-To: <201309261827.r8QIR2Y8090911@svn.freebsd.org> References: <201309261827.r8QIR2Y8090911@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 26, 2013 at 3:27 PM, Marcus von Appen <mva@freebsd.org> wrote: > Author: mva > Date: Thu Sep 26 18:27:02 2013 > New Revision: 328403 > URL: http://svnweb.freebsd.org/changeset/ports/328403 > > Log: > - Introduce a new port Makefile knob PYDISTUTILS_AUTOPLIST. > > This will cause the ports framework to create the plist automatically > for distutils-based ports. All files installed via Python's distutils > mechanisms (either the traditional distutils or easy_install) will be > automtically added to the package list, regardless of the Python > version. It is somewhat similar to the RUBYGEM_AUTOPLIST knob. > > - Introduce a new port Makefile knob PYTHON_PY3K_PLIST_HACK. > > This automatically replaces .pyc and .pyo package list entries with > the relevant __pycache__ entries for Python 3.x. It should only be > used for ports, which do not use one of Python's default package > installation mechanisms and which are guaranteed to work with any > python version. > > Modified: > head/Mk/bsd.python.mk > > Modified: head/Mk/bsd.python.mk > ============================================================================== > --- head/Mk/bsd.python.mk Thu Sep 26 18:23:42 2013 (r328402) > +++ head/Mk/bsd.python.mk Thu Sep 26 18:27:02 2013 (r328403) > @@ -94,16 +94,16 @@ Python_Include_MAINTAINER= python@FreeBS > # - Version of the default python2 binary in your ${PATH}, in > # the format "python2.7". Set this in your /etc/make.conf > # in case you want to use a specific version as a default. > -# Note that PYTHON_DEFAULT_VERSION always will have precedence > -# before this value, if it matches "python2*" > +# Note that PYTHON_DEFAULT_VERSION always will have > +# precedence before this value, if it matches "python2*" > # default: python2.7 > # > # PYTHON3_DEFAULT_VERSION > # - Version of the default python3 binary in your ${PATH}, in > # the format "python3.2". Set this in your /etc/make.conf > # in case you want to use a specific version as a default. > -# Note that PYTHON_DEFAULT_VERSION always will have precedence > -# before this value, if it matches "python3*" > +# Note that PYTHON_DEFAULT_VERSION always will have > +# precedence before this value, if it matches "python3*" > # default: python3.3 > # > # PYTHON_MAJOR_VER - Python version major number. 2 for python-2.x, > @@ -139,6 +139,17 @@ Python_Include_MAINTAINER= python@FreeBS > # PYSETUP - Name of the setup script used by the distutils package. > # default: setup.py > # > +# PYDISTUTILS_AUTOPLIST > +# - Generate the packaging list for distutils based ports > +# (including easy_install) automatically. > +# > +# PYTHON_PY3K_PLIST_HACK > +# - Automatically replaces .pyc and .pyo package list entries > +# with the relevant __pycache__ entries for Python 3.x. > +# This should only be used for ports, which do not use one > +# of Python's default package installation mechanisms and > +# which are guaranteed to work with any python version. > +# > # PYDISTUTILS_PKGNAME > # - Internal name in the distutils for egg-info. > # default: ${PORTNAME} > @@ -476,6 +487,7 @@ PYDISTUTILS_EGGINFO?= ${PYDISTUTILS_PKGN > PYDISTUTILS_EGGINFODIR?=${PYTHONPREFIX_SITELIBDIR} > > .if !defined(PYDISTUTILS_NOEGGINFO) && \ > + !defined(PYDISTUTILS_AUTOPLIST) && \ > (defined(INSTALLS_EGGINFO) || \ > (defined(USE_PYDISTUTILS) && \ > ${USE_PYDISTUTILS} != "easy_install")) && \ > @@ -485,6 +497,46 @@ PLIST_FILES+= ${PYDISTUTILS_EGGINFODIR:S > . endfor > .endif > > +.if defined(PYDISTUTILS_AUTOPLIST) && defined(USE_PYDISTUTILS) > +_PYTHONPKGLIST= ${WRKDIR}/.PLIST.pymodtmp > +PYDISTUTILS_INSTALLARGS:= --record ${_PYTHONPKGLIST} \ > + ${PYDISTUTILS_INSTALLARGS} > + > +_RELSITELIBDIR= ${PYTHONPREFIX_SITELIBDIR:S;${PREFIX}/;;} > + > +add-plist-post: add-plist-pymod > +add-plist-pymod: > + { ${ECHO_CMD} "#mtree"; ${CAT} ${MTREE_FILE}; } | ${TAR} tf - | \ > + ${SED} '/^\.$$/d' > ${WRKDIR}/.localmtree > + ${ECHO_CMD} "${_RELSITELIBDIR}" >> ${WRKDIR}/.localmtree > + ${SED} 's|^${PREFIX}/||' ${_PYTHONPKGLIST} | ${SORT} >> ${TMPPLIST} > + ${SED} -e 's|^${PREFIX}/\(.*\)/\(.*\)|\1|' ${_PYTHONPKGLIST} | \ > + while read line; do \ > + ${GREP} -qw "^$${line}$$" ${WRKDIR}/.localmtree || { \ > + [ -n "$${line}" ] && \ > + ${ECHO_CMD} "@unexec rmdir $${line} 2>/dev/null || true"; \ > + }; \ > + done | ${SORT} | uniq | ${SORT} -r >> ${TMPPLIST} This logic iteration to find directories seems wrong. If I am not wrong and we have: dira/dirb/file1 dira/dirc/file2 And no files within dira/ it endes up removing dira/dirb/ and dira/dirc/, but not dira/. Also, see this about enabling easy_install with AUTOPLIST and staging: http://people.freebsd.org/~wg/easyinstall-stage.txt Thanks -- William Grzybowski ------------------------------------------ Curitiba/PR - Brasil
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHtVNLPvWEO7bU1bUmc=gawB4HdytaTOosBR31V9JPBM_DYuyw>