Commit 81531862 authored by Andreas Henriksson's avatar Andreas Henriksson

Drop kbd init script and /etc/kbd/* if unused

We leave the files in the hands of the local admin if they seem to be
used. We're working under the assumption that most people use
console-setup, but that is not a hard requirement on Debian so we don't
want to yank the carpet under the feet for potential users of the kbd
script.
parent af88fdff
......@@ -13,6 +13,18 @@ case "$1" in
;;
esac
# see kbd.preinst for why this is conditional.
if [ ! -e /etc/kbd/config ] && [ ! -e /etc/kbd/remap ]; then
dpkg-maintscript-helper rm_conffile \
/etc/kbd/config 2.0.3-2~ kbd -- "$@"
dpkg-maintscript-helper rm_conffile \
/etc/kbd/remap 2.0.3-2~ kbd -- "$@"
dpkg-maintscript-helper rm_conffile \
/etc/init.d/kbd 2.0.3-2~ kbd -- "$@"
rmdir /etc/kbd 2>/dev/null || true
update-rc.d -f kbd remove
fi
#DEBHELPER#
# vim:sw=4:sts=4:et:
......@@ -12,6 +12,16 @@ case "$1" in
;;
esac
# see kbd.preinst for why this is conditional.
if [ ! -e /etc/kbd/config ] && [ ! -e /etc/kbd/remap ]; then
dpkg-maintscript-helper rm_conffile \
/etc/kbd/config 2.0.3-2~ kbd -- "$@"
dpkg-maintscript-helper rm_conffile \
/etc/kbd/remap 2.0.3-2~ kbd -- "$@"
dpkg-maintscript-helper rm_conffile \
/etc/init.d/kbd 2.0.3-2~ kbd -- "$@"
fi
#DEBHELPER#
# vim:sw=4:sts=4:et:
......@@ -2,6 +2,22 @@
set -e
is_unmodified() {
local PKGNAME="$1"
local CONFFILE="$2"
[ -e "$CONFFILE" ] || return 0
local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
if [ "$md5sum" = "$old_md5sum" ]; then
return 0
fi
return 1
}
mv_conffile() {
OLD="$1"
NEW="$2"
......@@ -25,6 +41,20 @@ case "$1" in
update-rc.d -f console-screen.kbd.sh remove
mv_conffile /etc/init.d/console-screen.kbd.sh /etc/init.d/kbd
fi
# remove init script and config unless it seems to be used.
if dpkg --compare-versions "$2" le '2.0.3-2~'; then
if is_unmodified kbd /etc/kbd/config && \
is_unmodified kbd /etc/kbd/remap; then
dpkg-maintscript-helper rm_conffile \
/etc/kbd/config 2.0.3-2~ kbd -- "$@"
dpkg-maintscript-helper rm_conffile \
/etc/kbd/remap 2.0.3-2~ kbd -- "$@"
dpkg-maintscript-helper rm_conffile \
/etc/init.d/kbd 2.0.3-2~ kbd -- "$@"
else
echo "Warning: leaving unsupported /etc/init.d/kbd and /etc/kbd/* in the hands of the local admin as they seem used... Please manually remove if unwanted. See /usr/share/doc/kbd/NEWS.Debian.gz"
fi
fi
esac
#DEBHELPER#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment