File: postinst

package info (click to toggle)
blackbox 0.51.3-13
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,168 kB
  • ctags: 1,307
  • sloc: cpp: 10,982; ansic: 476; sh: 370; makefile: 291; perl: 128
file content (46 lines) | stat: -rw-r--r-- 1,168 bytes parent folder | download
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
43
44
45
46
#!/bin/sh
#
#  Blackbox postinst
#
#  Shamelessly ripped off of Marcelo Magallon's script
#     by Brent Fulgham <bfulgham@debian.org>
#
set -e
inst=/etc/menu-methods/blackbox
WMentry="/usr/bin/blackbox"
script='print "'$WMentry'\n" unless (/^#(?!--)/ || $done) ; $done=1 unless /^#(?!--)/'

add_wm_entry ()
{
	update-alternatives --install /usr/bin/x-window-manager x-window-manager $WMentry 50 \
	--slave /usr/share/man/man1/x-window-manager.1.gz x-window-manager.1.gz /usr/share/man/man1/blackbox.1.gz
}

case "$1" in
    configure)
        if [ "$2" ] && dpkg --compare-versions $2 le 0.51.3-12; then
	    update-alternatives --remove x-window-manager /etc/X11/window-managers
	fi
        add_wm_entry
        
        if test -x /usr/sbin/wm-menu-config; then 
            wm-menu-config blackbox on; 
        fi
	if [ -f /etc/X11/blackbox/Blackbox-menu ]; then
		rm /etc/X11/blackbox/Blackbox-menu
	fi
	update-bbstyles --build

    ;;

    abort-upgrade|abort-deconfigure|abort-remove)
        # how did we get here?  Force a non-zero exit code
        exit 1
    ;;

    *)
        echo "postinst called with unknown argument: \$1" >&2
    ;;
esac

#DEBHELPER#