summaryrefslogtreecommitdiffstats
path: root/debian/powerline-gitstatus.preinst
blob: 22d6b0f090f809998e04f9396bf9edb04e018deb (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
#!/bin/sh

set -e

case "${1}" in
	install)
		mkdir -p /usr/share/powerline-gitstatus/divert

		for FILE in /usr/share/powerline/config_files/colorschemes/default.json \
			    /usr/share/powerline/config_files/themes/shell/default.json \
			    /usr/share/powerline/config_files/themes/shell/default_leftonly.json
		do
			DIVERTION="/usr/share/powerline-gitstatus/divert/$(basename $(dirname ${FILE}))_$(basename ${FILE}).powerline"

			dpkg-divert --package powerline-gitstatus --quiet --add --rename --divert "${DIVERTION}" "${FILE}"
		done
		;;

	upgrade|abort-upgrade)

		;;

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

#DEBHELPER#

exit 0