summaryrefslogtreecommitdiffstats
path: root/screen/screen.install
blob: 3ef5757d807ee6206cf54d12e0f1290ce8e0bec4 (plain)
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
37
38
39
40
41
42
infodir=/usr/share/info
filelist=(screen.info screen.info-1 screen.info-2 screen.info-3 screen.info-4 screen.info-5)

post_install() {
    [ -x usr/bin/install-info ] || return 0
    for file in ${filelist[@]}; do
        install-info $infodir/$file.gz $infodir/dir 2> /dev/null
    done
}

pre_upgrade() {
    compiled="/usr/share/terminfo/s/screen-256color"
    if [ -e $compiled ]; then
        if pacman -Qo $compiled 2>&1 | grep "No package owns" >/dev/null; then
            echo -n "removing compiled terminfo..."
            rm -f $compiled
            echo "done."
        fi
    fi
    compiled="/usr/share/terminfo/s/screen-256color-bce"
    if [ -e $compiled ]; then
        if pacman -Qo $compiled 2>&1 | grep "No package owns" >/dev/null; then
            echo -n "removing compiled terminfo..."
            rm -f $compiled
            echo "done."
        fi
    fi
}

post_upgrade() {
    post_install $1
}

pre_remove() {
    pre_upgrade $*

    [ -x usr/bin/install-info ] || return 0
    for file in ${filelist[@]}; do
        install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
    done
}