summaryrefslogtreecommitdiffstats
path: root/debian/powerline-gitstatus.preinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/powerline-gitstatus.preinst')
-rwxr-xr-xdebian/powerline-gitstatus.preinst31
1 files changed, 31 insertions, 0 deletions
diff --git a/debian/powerline-gitstatus.preinst b/debian/powerline-gitstatus.preinst
new file mode 100755
index 0000000..22d6b0f
--- /dev/null
+++ b/debian/powerline-gitstatus.preinst
@@ -0,0 +1,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