This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=ebbb81b5329f567f89ca576279bdeabafd291253

commit ebbb81b5329f567f89ca576279bdeabafd291253
Author: Guillem Jover <guil...@debian.org>
AuthorDate: Sun Nov 3 01:12:49 2019 +0100

    dselect: Remove methods state files on purge
    
    Ref: #930788
    Spotted-by: Sven Joachim <svenj...@gmx.de>
---
 Makefile.am           |  1 +
 debian/changelog      |  2 ++
 debian/dselect.postrm | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 37 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 5aa9ab4d7..86bc59184 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -82,6 +82,7 @@ EXTRA_DIST = \
        debian/dselect.docs \
        debian/dselect.install \
        debian/dselect.manpages \
+       debian/dselect.postrm \
        debian/libdpkg-dev.docs \
        debian/libdpkg-dev.install \
        debian/libdpkg-perl.docs \
diff --git a/debian/changelog b/debian/changelog
index febbcc200..3ebde1ef3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -79,6 +79,8 @@ dpkg (1.20.0) UNRELEASED; urgency=medium
     - Remove obsolete Breaks satisfied since oldstable.
     - Replace custom rule for 'configure' with call to dh_autoreconf.
       Thanks to Dan Streetman <ddstr...@canonical.com>. Closes: #939516
+    - dselect: Remove methods state files on purge.
+      Spotted by Sven Joachim <svenj...@gmx.de>.
   * Test suite:
     - Remove perlcritic Documentation::RequirePodLinksIncludeText suppression.
     - Clarify cppcheck va_list_usedBeforeStarted suppression.
diff --git a/debian/dselect.postrm b/debian/dselect.postrm
new file mode 100755
index 000000000..7376dd672
--- /dev/null
+++ b/debian/dselect.postrm
@@ -0,0 +1,34 @@
+#!/bin/sh
+# See deb-postrm(5).
+
+set -e
+
+# Remove dselect methods state.
+purge_state() {
+  admindir=${DPKG_ADMINDIR:-/var/lib/dpkg}
+
+  rm -f $admindir/cmethopt 2>/dev/null
+  for method in disk ftp mnt multicd; do
+    rm -rf $admindir/methods/$method/* 2>/dev/null
+  done
+}
+
+case "$1" in
+remove)
+  ;;
+purge)
+  purge_state
+  ;;
+upgrade)
+  ;;
+failed-upgrade|disappear|abort-install|abort-upgrade)
+  ;;
+*)
+  echo "$0 called with unknown argument '$1'" 1>&2
+  exit 1
+  ;;
+esac
+
+#DEBHELPER#
+
+exit 0

-- 
Dpkg.Org's dpkg

Reply via email to