File: preinst

package info (click to toggle)
bash-completion 1:2.11-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 6,352 kB
  • sloc: python: 8,225; makefile: 1,762; sh: 275; perl: 85; xml: 29; ansic: 7; ruby: 2
file content (36 lines) | stat: -rw-r--r-- 906 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

set -e

case "$1" in
    install|upgrade)
        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
        if dpkg --compare-versions "$2" lt-nl 1:2.0-1 &&
           dpkg --compare-versions "$2" ge 1:1.99-2 &&
           [ -L /etc/bash_completion ] &&
           [ "$(readlink /etc/bash_completion)" = \
             /usr/share/bash-completion/bash_completion ]; then
            rm -f /etc/bash_completion
        fi
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0