svn commit: r328403 - head/Mk
William Grzybowski
william88 at gmail.com
Thu Sep 26 20:54:55 UTC 2013
On Thu, Sep 26, 2013 at 3:27 PM, Marcus von Appen <mva at 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 at 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 at 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
More information about the svn-ports-head
mailing list