Codebase list kbd / 905cc07
Drop obsolete upgrade maintscript code The upgrade migration should have happened in debian buster, so no need to keep it around. The code also triggers a lintian warning: W: kbd: maintainer-script-should-not-use-dpkg-maintscript-helper postinst:19 N: N: The maintainer script seems to make manual calls to the N: dpkg-maintscript-helper(1) utility. N: N: Please use package.maintscript files instead; the dh_installdeb(1) tool N: will do some basic validation of some of the commands listed in this N: file to catch common mistakes. N: N: Refer to the dpkg-maintscript-helper(1) manual page and the N: dh_installdeb(1) manual page for details. N: N: Severity: warning N: N: Check: scripts Andreas Henriksson 4 years ago
3 changed file(s) with 0 addition(s) and 84 deletion(s). Raw diff Collapse all Expand all
1212 ;;
1313 esac
1414
15 # see kbd.preinst for why this is conditional.
16 if [ ! -e /etc/kbd/config ] && [ ! -e /etc/kbd/remap ]; then
17 dpkg-maintscript-helper rm_conffile \
18 /etc/kbd/config 2.0.3-2~ kbd -- "$@"
19 dpkg-maintscript-helper rm_conffile \
20 /etc/kbd/remap 2.0.3-2~ kbd -- "$@"
21 dpkg-maintscript-helper rm_conffile \
22 /etc/init.d/kbd 2.0.3-2~ kbd -- "$@"
23 rmdir /etc/kbd 2>/dev/null || true
24 update-rc.d -f kbd remove
25 fi
26
2715 #DEBHELPER#
2816
2917 # vim:sw=4:sts=4:et:
1111 ;;
1212 esac
1313
14 # see kbd.preinst for why this is conditional.
15 if [ ! -e /etc/kbd/config ] && [ ! -e /etc/kbd/remap ]; then
16 dpkg-maintscript-helper rm_conffile \
17 /etc/kbd/config 2.0.3-2~ kbd -- "$@"
18 dpkg-maintscript-helper rm_conffile \
19 /etc/kbd/remap 2.0.3-2~ kbd -- "$@"
20 dpkg-maintscript-helper rm_conffile \
21 /etc/init.d/kbd 2.0.3-2~ kbd -- "$@"
22 fi
23
2414 #DEBHELPER#
2515
2616 # vim:sw=4:sts=4:et:
+0
-62
debian/kbd.preinst less more
0 #!/bin/sh
1
2 set -e
3
4 is_unmodified() {
5 local PKGNAME="$1"
6 local CONFFILE="$2"
7
8 [ -e "$CONFFILE" ] || return 0
9
10 local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
11 local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
12 sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
13 if [ "$md5sum" = "$old_md5sum" ]; then
14 return 0
15 fi
16
17 return 1
18 }
19
20 mv_conffile() {
21 OLD="$1"
22 NEW="$2"
23 [ -e "$OLD" ] || return 0
24
25 MD5SUM=`md5sum "$OLD" | sed -e 's/ .*//'`
26 ORIG_MD5SUM=`dpkg-query -W -f='${Conffiles}' kbd | sed -n -e "\\' $OLD' { s/ obsolete$//; s/.* //; p }"`
27 if [ "$MD5SUM" = "$ORIG_MD5SUM" ]; then
28 echo "Removing obsolete unchanged conffile $OLD..." >&2
29 rm -f "$OLD"
30 else
31 echo "Moving obsolete customized conffile $OLD to $NEW..." >&2
32 mv -f "$OLD" "$NEW"
33 fi
34 }
35
36 case "$1" in
37 install|upgrade)
38 # rename init script from console-screen.kbd.sh to kbd
39 if dpkg --compare-versions "$2" le '1.15-3'; then
40 update-rc.d -f console-screen.kbd.sh remove
41 mv_conffile /etc/init.d/console-screen.kbd.sh /etc/init.d/kbd
42 fi
43 # remove init script and config unless it seems to be used.
44 if dpkg --compare-versions "$2" le '2.0.3-2~'; then
45 if is_unmodified kbd /etc/kbd/config && \
46 is_unmodified kbd /etc/kbd/remap; then
47 dpkg-maintscript-helper rm_conffile \
48 /etc/kbd/config 2.0.3-2~ kbd -- "$@"
49 dpkg-maintscript-helper rm_conffile \
50 /etc/kbd/remap 2.0.3-2~ kbd -- "$@"
51 dpkg-maintscript-helper rm_conffile \
52 /etc/init.d/kbd 2.0.3-2~ kbd -- "$@"
53 else
54 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"
55 fi
56 fi
57 esac
58
59 #DEBHELPER#
60
61 # vim:sw=4:sts=4:et: