]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix the Debian maintainerscript with versions based on debhelper
authorMark Schouten <mark@tuxis.nl>
Fri, 5 Sep 2014 09:43:26 +0000 (11:43 +0200)
committerMark Schouten <mark@tuxis.nl>
Fri, 5 Sep 2014 09:43:26 +0000 (11:43 +0200)
debian-pdns/pdns-doc.postinst [changed mode: 0755->0644]
debian-pdns/pdns-doc.prerm [changed mode: 0755->0644]
debian-pdns/pdns.postinst
debian-pdns/pdns.postrm
debian-pdns/pdns.prerm

old mode 100755 (executable)
new mode 100644 (file)
index 991c191..1bdda28
@@ -1,15 +1,24 @@
 #!/bin/sh
+# postinst script for pdns
 
 set -e
 
-update_docbase() {
-       if command -v install-docs >/dev/null 2>&1 ; then
-               install-docs -i /usr/share/doc-base/pdns
-       fi
-}
+case "$1" in
+    configure|abort-upgrade)
+           if command -v install-docs >/dev/null 2>&1 ; then
+            install-docs -i /usr/share/doc-base/pdns
+        fi
+    ;;
 
+    abort-remove|abort-deconfigure)
+    ;;
 
-if [ "$1" = "configure" -o "$1" = "abort-upgrade" ] ; then
-       update_docbase
-fi
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
 
+#DEBHELPER#
+
+exit 0
old mode 100755 (executable)
new mode 100644 (file)
index 378fd30..614e989
@@ -1,13 +1,24 @@
 #!/bin/sh
+# prerm script for pdns
 
 set -e
 
-update_docbase() {
-       if command -v install-docs >/dev/null 2>&1 ; then
-               install-docs -r pdns
-       fi
-}
+case "$1" in
+    remove)
+        if command -v install-docs >/dev/null 2>&1 ; then
+            install-docs -r pdns
+        fi
+    ;;
 
-if [ "$1" = "remove" ] ; then
-       update_docbase
-fi
+    failed-upgrade|upgrade|deconfigure)
+    ;;
+
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
index 30a43e18a73f5fddc2e40b9a0b899ca3cf46ff66..b994c9e2a9907e001b0de5940aa353ee61d61437 100755 (executable)
@@ -1,23 +1,26 @@
 #!/bin/sh
+# postinst script for pdns
 
 set -e
 
-update_init() {
-       if [ -z "$2" ] ; then
-               update-rc.d pdns defaults 15 85 > /dev/null
-       fi
-}
+case "$1" in
+    configure)
+        if [ -z $2 ]; then
+            update-rc.d pdns defaults 15 85 > /dev/null
+            invoke-rc.d pdns start
+        else
+            invoke-rc.d pdns status > /dev/null
+            [ $? -eq 3 ] || invoke-rc.d pdns restart
+        fi
+    ;;
 
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
 
-update_pdns() {
-       if [ -n "$2" ] ; then
-               invoke-rc.d pdns start
-       else
-               invoke-rc.d pdns restart
-       fi
-}
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
 
-if [ "$1" = "configure" -o "$1" = "abort-upgrade" ] ; then
-       update_init "$@"
-       update_pdns "$@"
-fi
+exit 0
index 91b80e86feb40d49cd6e790b7b59823b2a9f3294..02139ffa54bedd1f8164f619fd95a7c1395d2ccb 100755 (executable)
@@ -1,14 +1,22 @@
 #!/bin/sh
+# postrm script for pdns
 
 set -e
 
-update_init() {
-       update-rc.d pdns remove > /dev/null
-}
+case "$1" in
+    purge|remove)
+        update-rc.d pdns remove
+    ;;
 
+    |upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
 
-if [ "$1" = "purge" ] ; then
-       update_init
-       rmdir /etc/powerdns || true
-fi
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
 
+#DEBHELPER#
+
+exit 0
index 8fd3405e0054e2196169c82f1734b9294fe68a99..5a312c73360147aeb2c687a73c98feda50f13388 100755 (executable)
@@ -1,11 +1,26 @@
 #!/bin/sh
+# prerm script for pdns
 
 set -e
 
-if [ "$1" = "remove" ] ; then
-       if command -v invoke-rc.d >/dev/null 2>&1; then
-               invoke-rc.d pdns stop
-       else
-               /etc/init.d/pdns stop
-       fi
-fi
+case "$1" in
+    remove|upgrade|deconfigure)
+        if command -v invoke-rc.d >/dev/null 2>&1; then
+            invoke-rc.d pdns stop
+        else
+            /etc/init.d/pdns stop
+        fi
+    ;;
+
+    failed-upgrade)
+    ;;
+
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0