summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2020-03-06 16:54:18 +0100
committerDidier Raboud <odyx@debian.org>2020-03-06 17:13:28 +0100
commit995ff5c84fe1a9aaa057da01142e7bdebe6ef79e (patch)
tree4feb00dc54aa470683f228d5f76ac33d10d320ae
parenteb428fc846ddc4ffaa4083652afea4cf810979f0 (diff)
Empty hplip-data's /usr/share/hplip/*/__pycache__ in postrm
Closes: #953097
-rwxr-xr-xdebian/hplip-data.prerm11
1 files changed, 11 insertions, 0 deletions
diff --git a/debian/hplip-data.prerm b/debian/hplip-data.prerm
new file mode 100755
index 000000000..9edd422ac
--- /dev/null
+++ b/debian/hplip-data.prerm
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -e
+
+#DEBHELPER#
+
+if [ "$1" = "purge" ]; then
+ # Inspired by dh_python3
+ dpkg -L hplip-data | perl -ne 's,/([^/]*)\.py$,/__pycache__/\1.*, or next; unlink $_ or die $! foreach glob($_)'
+ find /usr/share/hplip/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir
+fi
+