retitle 504793 /etc/inputrc, once installed, is never replaced by newer versions
severity 504793 normal
tags 504793 patch
thanks

Hi there,

I am rasing the severity as the current behaviour is quite surprising
and, with all due respect, I fail to see why /etc/inputrc shall never
be updated, unlike other conffiles.

Yes I do have systems that once were installed more than ten years ago
using woody and are now wheezy. On these boxes, files like and as old
as

-rw-r--r-- 1 root root  422 Aug 22  2001 /etc/inputrc

still were around, annoying me with some defects like Ctrl-Left/Right
for movement do not work in e.g. bash.

The preliminary (postrm might require some love) patch attached
creates the usual behaviour for upgrades: Tell the administrator about
a change and let them decide what to do. Using ucf for that might be a
bit oversized but keeps the patch small.

Applies to wheezy (6.2-8), works for me.

    Christoph

diff --git a/debian/control b/debian/control
index 5b85416..505c52a 100644
--- a/debian/control
+++ b/debian/control
@@ -42,7 +42,7 @@ Package: readline-common
 Architecture: all
 Multi-Arch: foreign
 Section: utils
-Depends: dpkg (>= 1.15.4) | install-info, ${misc:Depends}
+Depends: dpkg (>= 1.15.4) | install-info, ucf, ${misc:Depends}
 Conflicts: libreadline5 (<< 5.0-11), libreadline-common
 Replaces: libreadline4 (<< 4.3-16), libreadline5 (<< 5.0-11), 
libreadline-common
 Priority: important
diff --git a/debian/readline-common.postinst b/debian/readline-common.postinst
index 1a664cf..38a37ea 100644
--- a/debian/readline-common.postinst
+++ b/debian/readline-common.postinst
@@ -1,13 +1,12 @@
 #! /bin/sh -e
 
-install_from_default() {
-  if [ ! -f $2 ]; then
-    cp -p $1 $2
-  fi
-}
-
-if [ "$1" = "configure" ] && [ "$2" = "" ]; then
-  install_from_default /usr/share/readline/inputrc /etc/inputrc
+if [ "$1" = "configure" ] ; then
+    if [ ! -f /etc/inputrc ]; then
+       cp -p /usr/share/readline/inputrc /etc/inputrc
+    else
+       ucf --debconf-ok --three-way /usr/share/readline/inputrc /etc/inputrc
+    fi
+    ucfr readline-common /etc/inputrc
 fi
 
 #DEBHELPER#
diff --git a/debian/readline-common.postrm b/debian/readline-common.postrm
index 9a19c2d..4e752fa 100644
--- a/debian/readline-common.postrm
+++ b/debian/readline-common.postrm
@@ -2,7 +2,8 @@
 
 case "$1" in
     purge)
-       rm -f /etc/inputrc
+       rm -f /etc/inputrc.{ucf-new,ucf-old,ucf-dist}
+       ucf --purge /etc/inputrc && ucfr --purge readline-common /etc/inputrc 
&& rm -f /etc/inputrc
 esac
 
 #DEBHELPER#

Attachment: signature.asc
Description: Digital signature

Reply via email to