1 |
This patch for python.eclass has been divided into 3 subpatches to simplify review. |
2 |
|
3 |
Subpatch #1 fixes preservation of whitespace. |
4 |
|
5 |
Subpatch #2 renames 2 local arrays in python_mod_optimize() function: |
6 |
site_packages_absolute_dirs -> dirs |
7 |
site_packages_absolute_files -> files |
8 |
|
9 |
Subpatch #3 adds --allow-evaluated-non-sitedir-paths option to python_mod_optimize() and |
10 |
python_mod_cleanup() functions. |
11 |
In rare cases, packages supporting installation for multiple Python ABIs install .py files |
12 |
outside of site-packages directories. python_mod_optimize() and python_mod_cleanup() |
13 |
functions currently don't support such paths. It's better to not allow such paths by |
14 |
default, so this subpatch adds new --allow-evaluated-non-sitedir-paths option to these |
15 |
functions. This option is disallowed in packages not supporting installation for multiple |
16 |
Python ABIs. Such paths are internally evaluated inside these functions. Such paths work |
17 |
correctly only if they contain '${PYTHON_ABI}' or '$(python_get_version)' (probably with |
18 |
'$(python_get_implementation)') or '$(custom_function)' (where custom_function() uses |
19 |
"${PYTHON_ABI}" or "$(python_get_version)" and prints appropriate output), so there are |
20 |
sanity checks, which ensure that such paths contain '$'. |
21 |
|
22 |
Example usage: |
23 |
|
24 |
pkg_postinst() { |
25 |
python_mod_optimize --allow-evaluated-non-sitedir-paths '/usr/share/package_name/${PYTHON_ABI}' |
26 |
} |
27 |
|
28 |
pkg_postrm() { |
29 |
python_mod_cleanup --allow-evaluated-non-sitedir-paths '/usr/share/package_name/${PYTHON_ABI}' |
30 |
} |
31 |
|
32 |
This functionality is needed by Zope 2.12 / 2.13. |
33 |
|
34 |
-- |
35 |
Arfrever Frehtes Taifersar Arahesis |