distutils.eclass allows setting PYTHON_MODNAME to a space-separated list of packages that have their .pyc/.pyo files removed after uninstall. However it won't automagically optimize all modules. The following: --- /usr/portage/eclass/distutils.eclass 2004-09-16 01:35:59.000000000 +0200 +++ distutils.eclass 2005-06-17 17:59:36.000000000 +0200 @@ -87,7 +87,7 @@ if has_version ">=dev-lang/python-2.3"; then python_version - for pymod in "${PYTHON_MODNAME}"; do + for pymod in ${PYTHON_MODNAME}; do if [ -d "${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}" ]; then python_mod_optimize ${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/${pymod} fi fixes it. distutils_pkg_postrm already has the variable unquoted, so I'm pretty sure this is ok. Reproducible: Always Steps to Reproduce: 1. emerge a package with PYTHON_MODNAME="nevow formless" Actual Results: Get no precompiled .pyc/.pyo files, but do get proper cleanup messages ("Cleaning orphaned Python bytecode from ${path} .." for both nevow and formless) Expected Results: Proper "mod_optimize".
Checked in, closing.