1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-10 07:04:03 +00:00
freebsd-ports/audio/oss/files/pkg-deinstall.in
Jung-uk Kim f1eb4bbbf1 - Unbreak build on 5.x.[1]
- Remove userdefs if it is unchanged or empty.

PR:		ports/117826
Reported by:	pointyhat
Submitted by:	Yen-Ming Lee (leeym at leeym dot com)[1]
Approved by:	portmgr (linimon)
2007-11-13 15:59:06 +00:00

18 lines
625 B
Bash

#! /bin/sh
case $2 in
DEINSTALL)
if test -f %%PREFIX%%/lib/oss/etc/installed_drivers; then
rm -f %%PREFIX%%/lib/oss/etc/installed_drivers
fi
if test -f %%PREFIX%%/lib/oss/etc/userdefs; then
mv -f %%PREFIX%%/lib/oss/etc/userdefs %%PREFIX%%/lib/oss/etc/userdefs.bak
/usr/bin/grep -v '^autosave_mixer yes$' %%PREFIX%%/lib/oss/etc/userdefs.bak > %%PREFIX%%/lib/oss/etc/userdefs
if /usr/bin/cmp %%PREFIX%%/lib/oss/etc/userdefs /dev/null; then
rm -f %%PREFIX%%/lib/oss/etc/userdefs %%PREFIX%%/lib/oss/etc/userdefs.bak
else
mv -f %%PREFIX%%/lib/oss/etc/userdefs.bak %%PREFIX%%/lib/oss/etc/userdefs
fi
fi
esac