Gentoo Archives: gentoo-dev

From: Arfrever Frehtes Taifersar Arahesis <Arfrever@g.o>
To: Gentoo Development <gentoo-dev@l.g.o>
Cc: qa@g.o
Subject: [gentoo-dev] Patch for python.eclass
Date: Mon, 20 Sep 2010 02:07:53
This patch for python.eclass has been divided into 3 subpatches to simplify review.

Subpatch #1 fixes preservation of whitespace.

Subpatch #2 renames 2 local arrays in python_mod_optimize() function:
  site_packages_absolute_dirs  -> dirs
  site_packages_absolute_files -> files

Subpatch #3 adds --allow-evaluated-non-sitedir-paths option to python_mod_optimize() and
python_mod_cleanup() functions.
In rare cases, packages supporting installation for multiple Python ABIs install .py files
outside of site-packages directories. python_mod_optimize() and python_mod_cleanup()
functions currently don't support such paths. It's better to not allow such paths by
default, so this subpatch adds new --allow-evaluated-non-sitedir-paths option to these
functions. This option is disallowed in packages not supporting installation for multiple
Python ABIs. Such paths are internally evaluated inside these functions. Such paths work
correctly only if they contain '${PYTHON_ABI}' or '$(python_get_version)' (probably with
'$(python_get_implementation)') or '$(custom_function)' (where custom_function() uses
"${PYTHON_ABI}" or "$(python_get_version)" and prints appropriate output), so there are
sanity checks, which ensure that such paths contain '$'.

Example usage:

pkg_postinst() {
    python_mod_optimize --allow-evaluated-non-sitedir-paths '/usr/share/package_name/${PYTHON_ABI}'

pkg_postrm() {
    python_mod_cleanup --allow-evaluated-non-sitedir-paths '/usr/share/package_name/${PYTHON_ABI}'

This functionality is needed by Zope 2.12 / 2.13.

Arfrever Frehtes Taifersar Arahesis


File name MIME type
python.eclass.patch text/x-patch
python.eclass.patch.1 text/x-patch
python.eclass.patch.2 text/x-patch
python.eclass.patch.3 text/x-patch
signature.asc application/pgp-signature


Subject Author
Re: [gentoo-dev] Patch for python.eclass Arfrever Frehtes Taifersar Arahesis <Arfrever@g.o>
[gentoo-dev] Re: Patch for python.eclass Mike Frysinger <vapier@g.o>