]> git.deb.at Git - pkg/beep.git/blobdiff - debian/postinst
Rewrite debian/copyright in DEP-5 format
[pkg/beep.git] / debian / postinst
index 34b56d525d7a9cfb1649ee5eeda67bb68b057d40..29eb0c15da58b0211696e079cb5d3d054c087799 100644 (file)
@@ -1,5 +1,22 @@
-#!/bin/sh -e
+#!/bin/sh
 # postinst for beep
+# copyright 2002-2016 by Rhonda D'Vine <rhonda@debian.org>
+# Licenced under WTFPLv2
+
+set -e
+
+pathfind() {
+    OLDIFS="$IFS"
+    IFS=:
+    for p in $PATH; do
+        if [ -x "$p/$*" ]; then
+            IFS="$OLDIFS"
+            return 0
+        fi
+    done
+    IFS="$OLDIFS"
+    return 1
+}
 
 # Source debconf library.
 if [ -e /usr/share/debconf/confmodule ]; then
@@ -16,12 +33,6 @@ if [ -e /usr/share/debconf/confmodule ]; then
        suid="$RET"
 fi
 
-# repair typo in option (see #135866)
-if [ "$suid" = "suid root with only group audio executeable" ] ; then
-       db_set beep/suid_option "suid root with only group audio executable"
-       suid="suid root with only group audio executable"
-fi
-
 # option changes as suggested by #492724
 if [ "$suid" = "suid root for all" ] ; then
        db_set beep/suid_option "usable for all"
@@ -37,7 +48,7 @@ if [ "$suid" = "not suid at all" ] ; then
 fi
 
 
-if [ -x /usr/sbin/dpkg-statoverride ] ; then
+if pathfind dpkg-statoverride ; then
        if ! dpkg-statoverride --list /usr/bin/beep >/dev/null ; then
                if [ "$suid" = "usable for all" ] ; then
                        chmod 4755 /usr/bin/beep
@@ -56,3 +67,5 @@ else
                chmod 0755 /usr/bin/beep
        fi
 fi
+
+#DEBHELPER#