Source: python3-stdlib-extensions
Version: 3.6.5-2
Severity: normal
Tags: patch
While testing src:gtk+3.0 with piuparts:
> dpkg: warning: while removing libpython3.6-stdlib:amd64, directory
> '/usr/lib/python3.6/distutils' not empty so not removed
...
>1m6.8s ERROR: FAIL: Package purging left files on system:
> /usr/lib/python3.6/ owned by: python3-distutils, python3.6,
> libpython3.6-stdlib:amd64, python3-lib2to3, libpython3.6-minimal:amd64
> /usr/lib/python3.6/distutils/ owned by: python3-distutils,
> libpython3.6-stdlib:amd64
> /usr/lib/python3.6/distutils/command/ owned by: python3-distutils
> /usr/lib/python3.6/lib2to3/ owned by: python3-lib2to3
> /usr/lib/python3.6/lib2to3/fixes/ owned by: python3-lib2to3
> /usr/lib/python3.6/lib2to3/pgen2/ owned by: python3-lib2to3
The version of this package in testing has this as the most recent
changelog entry:
> python3-stdlib-extensions (3.6.5~rc1-1) unstable; urgency=medium
>
> * Update 3.6 extensions to the 3.6.5 release candidate.
> * Update 3.7 extensions and modules to 3.7.0~b1.
> * Clean up empty __pycache__ directories in prerm (Simon McVittie).
> Closes: #884593, #885553, #885664, #886124.
>
> -- Matthias Klose <[email protected]> Wed, 14 Mar 2018 08:28:00 +0100
but in unstable the corresponding changelog entry has turned into:
> python3-stdlib-extensions (3.6.5~rc1-1) unstable; urgency=medium
>
> * Update 3.6 extensions to the 3.6.5 release candidate.
> * Update 3.7 extensions and modules to 3.7.0~b1.
>
> -- Matthias Klose <[email protected]> Wed, 14 Mar 2018 08:28:00 +0100
losing the patch you applied for <https://bugs.debian.org/886124>.
Please make sure that new changes to this package do not cause old changes
to get lost. Maintaining it in a VCS, for instance under
<https://salsa.debian.org/python-team/>, seems like a good way to arrange
for the right things to happen.
I attach a copy of the lost changes.
Regards,
smcv
diff --git a/debian/python3-distutils.prerm b/debian/python3-distutils.prerm
index bdc8320..0d2691a 100644
--- a/debian/python3-distutils.prerm
+++ b/debian/python3-distutils.prerm
@@ -10,6 +10,14 @@ remove_bytecode()
| awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \
| xargs --max-chars="$max" echo \
| while read files; do rm -f $files; done
+ dpkg -L "$pkg" \
+ | sed -ne 's,^\(/.*/\)[^/]*\.py$,\1__pycache__,p' \
+ | sort -u \
+ | while read dir; do \
+ if [ -d "$dir" ]; then \
+ rmdir --ignore-fail-on-non-empty "$dir"; \
+ fi; \
+ done
}
case "$1" in
diff --git a/debian/python3-lib2to3.prerm b/debian/python3-lib2to3.prerm
index a70657c..30bb55b 100644
--- a/debian/python3-lib2to3.prerm
+++ b/debian/python3-lib2to3.prerm
@@ -10,6 +10,14 @@ remove_bytecode()
| awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \
| xargs --max-chars="$max" echo \
| while read files; do rm -f $files; done
+ dpkg -L "$pkg" \
+ | sed -ne 's,^\(/.*/\)[^/]*\.py$,\1__pycache__,p' \
+ | sort -u \
+ | while read dir; do \
+ if [ -d "$dir" ]; then \
+ rmdir --ignore-fail-on-non-empty "$dir"; \
+ fi; \
+ done
}
case "$1" in
diff --git a/debian/python3-tk.prerm b/debian/python3-tk.prerm
index 92ae334..0960289 100644
--- a/debian/python3-tk.prerm
+++ b/debian/python3-tk.prerm
@@ -10,6 +10,14 @@ remove_bytecode()
| awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \
| xargs --max-chars="$max" echo \
| while read files; do rm -f $files; done
+ dpkg -L "$pkg" \
+ | sed -ne 's,^\(/.*/\)[^/]*\.py$,\1__pycache__,p' \
+ | sort -u \
+ | while read dir; do \
+ if [ -d "$dir" ]; then \
+ rmdir --ignore-fail-on-non-empty "$dir"; \
+ fi; \
+ done
}
case "$1" in