The following commit has been merged in the master branch:
commit d93bd9fc6119fef6d4c62812db63e93014f86581
Author: David Paleino <[email protected]>
Date:   Wed Apr 6 19:20:39 2011 +0200

    Remove old conffiles, using dpkg-maintscript-helper

diff --git a/debian/changelog b/debian/changelog
index f6032ea..a97ede6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,8 +5,9 @@ bash-completion (1:1.3-2) UNRELEASED; urgency=low
   * Implement triggers: activate completions when something is installed
     in $PATH (drawback: paths are hardcoded in debian/triggers)
   * Remove old UCF-related postinst tasks
+  * Remove old conffiles, using dpkg-maintscript-helper
 
- -- David Paleino <[email protected]>  Wed, 06 Apr 2011 18:28:50 +0200
+ -- David Paleino <[email protected]>  Wed, 06 Apr 2011 19:20:25 +0200
 
 bash-completion (1:1.3-1) unstable; urgency=low
 
diff --git a/debian/postinst b/debian/postinst
index 0d5a2ad..4e32eae 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -9,6 +9,10 @@ case "$1" in
         for c in $(/usr/share/bash-completion/get-completions 
/usr/share/bash-completion/compdict | sort -u); do
             ln -sf /usr/share/bash-completion/$c 
/etc/bash_completion.d/triggered/
         done
+        # let's remove old bash-completion conffiles
+        for f in $(find /etc/bash_completion.d/ -type f -name "*.dpkg-*"); do
+            dpkg-maintscript-helper rm_conffile ${f%.dpkg-*} 1:1.3-1 -- "$@"
+        done
        ;;
     abort-upgrade|abort-remove|abort-deconfigure)
        ;;
diff --git a/debian/postrm b/debian/postrm
index a08e9e9..18eb69f 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -1,10 +1,14 @@
-#!/bin/sh
+#!/bin/bash
 
 set -e
 
 case "$1" in
     purge)
        rm -f /etc/bash_completion
+        # let's remove old bash-completion conffiles
+        for f in $(find /etc/bash_completion.d/ -type f -name "*.dpkg-*"); do
+            dpkg-maintscript-helper rm_conffile ${f%.dpkg-*} 1:1.3-1 -- "$@"
+        done
        ;;
     remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
        ;;
diff --git a/debian/preinst b/debian/preinst
index 9017ada..c1237fc 100644
--- a/debian/preinst
+++ b/debian/preinst
@@ -7,6 +7,10 @@ case "$1" in
        if [ -e /usr/share/doc/bash/completion-contrib ]; then
            rm -rf /usr/share/doc/bash/completion-contrib
        fi
+        # let's remove old bash-completion conffiles
+        for f in $(dpkg-query -W -f='${Conffiles}\n' bash-completion | grep 
bash_completion.d | cut -d\  -f2); do
+            dpkg-maintscript-helper rm_conffile $f 1:1.3-1 -- "$@"
+        done
     ;;
 
     abort-upgrade)

-- 
debian-package

_______________________________________________
Bash-completion-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-commits

Reply via email to