File: postinst

package info (click to toggle)
fvwm-crystal 3.4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 21,700 kB
  • ctags: 1,494
  • sloc: sh: 3,265; cs: 1,335; python: 875; makefile: 214
file content (41 lines) | stat: -rw-r--r-- 1,232 bytes parent folder | download | duplicates (5)
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
#!/bin/sh

set -e

#DEBHELPER#

FC_BASE="/usr/share/fvwm-crystal/fvwm"
FC_ICONBASE="${FC_BASE}/icons/Default"
FC_APPBASE="${FC_BASE}/Applications/debian"

SIZES="22x22 32x32 48x48"

# versions 3.0-1 - 3.0.3-1 of the package put the debianmenu in
# /usr/share/fvwm-crystal. Since then the debian menu resides in
# /var/lib/fvwm-crystal. Since function removes the menu from the
# old location, if present, when upgrading to this version.
removeLegacyMenu() {
	if [ ! -d "${FC_APPBASE}" ]; then return; fi
	for size in ${SIZES}; do
		if [ ! -d "${FC_ICONBASE}/${size}/debianmenu/" ]; then
			continue
		fi
		for file in `find ${FC_ICONBASE}/${size}/debianmenu/ -name "*.png"`; do
			rm -f -- "`readlink "${file}"`"
			rm -f -- "${file}"
		done
		rmdir --ignore-fail-on-non-empty "${FC_ICONBASE}/${size}/debianmenu/"
	done
	rm -rf -- "${FC_APPBASE}"
}

removeLegacyMenu

if [ "$1" = "configure" ]; then
update-alternatives --install /usr/bin/x-window-manager x-window-manager \
                              /usr/bin/fvwm-crystal 50 \
                    --slave   /usr/share/man/man1/x-window-manager.1.gz \
                              x-window-manager.1.gz \
                              /usr/share/man/man1/fvwm-crystal.1.gz
fi