X-Git-Url: https://git.deb.at/w?p=pkg%2Fbeep.git;a=blobdiff_plain;f=debian%2Fpostinst;h=29eb0c15da58b0211696e079cb5d3d054c087799;hp=dc97dc008b2eab87d1fc39fd176c16e884a7f055;hb=a7ba3628a25ce13e6c1fe738b88a2a5f46673604;hpb=29f418e5b19fdabcb2ad6735a4d92b269ab3cfb3 diff --git a/debian/postinst b/debian/postinst index dc97dc0..29eb0c1 100644 --- a/debian/postinst +++ b/debian/postinst @@ -1,10 +1,23 @@ #!/bin/sh # postinst for beep -# copyright 2002-2011 by Rhonda D'Vine +# copyright 2002-2016 by Rhonda D'Vine # 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 . /usr/share/debconf/confmodule @@ -35,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