distutils-r1.eclass: Namespace & doc _clean_egg_info
authorMichał Górny <mgorny@gentoo.org>
Fri, 5 May 2017 21:20:12 +0000 (23:20 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 16 May 2017 17:11:29 +0000 (19:11 +0200)
Prefix the _clean_egg_info function with an appropriate namespace,
and document its purpose with eclassdoc format. Be more verbose
on the exact problem being solved; remove URL to old upstream bug
tracker that no longer exists.

eclass/distutils-r1.eclass

index 5df7234332d3f8e62e830de919244f150e8a9813..1376326c957938ce1efdedc64b3a6d8e08dc6a94 100644 (file)
@@ -770,10 +770,14 @@ distutils-r1_src_compile() {
        fi
 }
 
-_clean_egg_info() {
-       # Work around for setuptools test behavior (bug 534058).
-       # https://bitbucket.org/pypa/setuptools/issue/292
-       rm -rf "${BUILD_DIR}"/lib/*.egg-info
+# @FUNCTION: _distutils-r1_clean_egg_info
+# @INTERNAL
+# @DESCRIPTION:
+# Clean up potential stray egg-info files left by setuptools test phase.
+# Those files ended up being unversioned, and caused issues:
+# https://bugs.gentoo.org/534058
+_distutils-r1_clean_egg_info() {
+       rm -rf "${BUILD_DIR}"/lib/*.egg-info || die
 }
 
 distutils-r1_src_test() {
@@ -781,7 +785,7 @@ distutils-r1_src_test() {
 
        if declare -f python_test >/dev/null; then
                _distutils-r1_run_foreach_impl python_test
-               _distutils-r1_run_foreach_impl _clean_egg_info
+               _distutils-r1_run_foreach_impl _distutils-r1_clean_egg_info
        fi
 
        if declare -f python_test_all >/dev/null; then