X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=debian%2Fpostinst;h=29eb0c15da58b0211696e079cb5d3d054c087799;hb=dbf0b43eff7da870aa455ab01af1f0e711c4c1a8;hp=b60608eef594e4e21e5ba9ae40d9d07a8bba3bfd;hpb=3e366a8559a933d9b1d463255441f97812382d0b;p=pkg%2Fbeep.git diff --git a/debian/postinst b/debian/postinst index b60608e..29eb0c1 100644 --- a/debian/postinst +++ b/debian/postinst @@ -1,7 +1,22 @@ -#!/bin/sh -e +#!/bin/sh # postinst for beep -# copyright 2002-2009 by Gerfried Fuchs -# Licenced under BSD style +# 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 @@ -33,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 @@ -52,3 +67,5 @@ else chmod 0755 /usr/bin/beep fi fi + +#DEBHELPER#