commit:     caab06d4a89e612d7d7deef236d5fba61a98e576
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 27 14:11:44 2016 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Jan 27 14:11:44 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=caab06d4

dev-python/six: Remove any existing egg-info directory

Bug: https://bugs.gentoo.org/573114

Package-Manager: portage-2.2.27_p49

 dev-python/six/six-1.10.0.ebuild   | 13 +++++++++++++
 dev-python/six/six-1.9.0-r1.ebuild | 13 +++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/dev-python/six/six-1.10.0.ebuild b/dev-python/six/six-1.10.0.ebuild
index baf5f47..f0d2eef 100644
--- a/dev-python/six/six-1.10.0.ebuild
+++ b/dev-python/six/six-1.10.0.ebuild
@@ -48,3 +48,16 @@ python_install_all() {
        use doc && local HTML_DOCS=( documentation/_build/html/ )
        distutils-r1_python_install_all
 }
+
+pkg_preinst() {
+       # Remove this in the next version bump
+       _cleanup() {
+               local pyver=$("${PYTHON}" -c "from distutils.sysconfig import 
get_python_version; print(get_python_version())")
+               local 
egginfo="${ROOT%/}$(python_get_sitedir)/${P}-py${pyver}.egg-info"
+               if [[ -d ${egginfo} ]]; then
+                       echo rm -r "${egginfo}"
+                       rm -r "${egginfo}" || die "Failed to remove egg-info 
directory"
+               fi
+       }
+       python_foreach_impl _cleanup
+}

diff --git a/dev-python/six/six-1.9.0-r1.ebuild 
b/dev-python/six/six-1.9.0-r1.ebuild
index 7553b1d..de1f0c9 100644
--- a/dev-python/six/six-1.9.0-r1.ebuild
+++ b/dev-python/six/six-1.9.0-r1.ebuild
@@ -39,3 +39,16 @@ python_install_all() {
        use doc && local HTML_DOCS=( documentation/_build/html/ )
        distutils-r1_python_install_all
 }
+
+pkg_preinst() {
+       # Remove this in the next version bump
+       _cleanup() {
+               local pyver=$("${PYTHON}" -c "from distutils.sysconfig import 
get_python_version; print(get_python_version())")
+               local 
egginfo="${ROOT%/}$(python_get_sitedir)/${P}-py${pyver}.egg-info"
+               if [[ -d ${egginfo} ]]; then
+                       echo rm -r "${egginfo}"
+                       rm -r "${egginfo}" || die "Failed to remove egg-info 
directory"
+               fi
+       }
+       python_foreach_impl _cleanup
+}

Reply via email to