debian/preinst
changeset 90 4e18894dec80
parent 69 f4e4b8d01322
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/preinst	Mon Jan 05 11:31:55 2015 +0100
@@ -0,0 +1,39 @@
+#! /bin/sh
+# preinst script for logbuch
+#
+# see: dh_installdeb(1)
+
+set -e
+
+case "$1" in
+    install|upgrade)
+        if  [ -n "$2" ] && \
+            dpkg --compare-versions "$2" le "0.39" && \
+            [ -f /etc/logbuch/config.pm ]; then
+            dirs=$(perl -e 'use lib "/etc/logbuch"; use config; print join " ", @config::notify_dirs');
+            if [ -n "$dirs" ]; then
+                for d in "$dirs"; do
+                    if [ -d $d/.hg ]; then
+                        chmod -R go= $d/.hg
+                    else
+                        echo "Warning: '$d/.hg' is not a directory" >&2
+                    fi
+                done
+            fi
+        fi
+    ;;
+
+    abort-upgrade)
+    ;;
+
+    *)
+        echo "preinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
+