From 1f563de14643cdde77bf15143025043c90b3234e Mon Sep 17 00:00:00 2001 From: Rong-En Fan Date: Mon, 7 Jan 2008 14:08:44 +0000 Subject: [PATCH] - Fix pkg-plist - Remove user/group if PACKAGE_BUILDING or BATCH Reported by: pointyhat via erwin --- net-mgmt/netdisco/pkg-deinstall | 12 ++++++++++-- net-mgmt/netdisco/pkg-plist | 10 +++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/net-mgmt/netdisco/pkg-deinstall b/net-mgmt/netdisco/pkg-deinstall index e093620c3af5..4b4445a9f88e 100644 --- a/net-mgmt/netdisco/pkg-deinstall +++ b/net-mgmt/netdisco/pkg-deinstall @@ -10,11 +10,19 @@ GROUP=${USER} echo "" if pw usershow "${USER}" 2>/dev/null 1>&2; then - echo "To delete the netdisco user permanently, use 'pw userdel ${USER}'." + if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then + echo "To delete the netdisco user permanently, use 'pw userdel ${USER}'." + else + pw userdel ${USER} + fi fi if pw groupshow "${GROUP}" 2>/dev/null 1>&2; then - echo "To delete the netdisco group permanently, use 'pw groupdel ${GROUP}'." + if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then + echo "To delete the netdisco group permanently, use 'pw groupdel ${GROUP}'." + else + pw groupdel ${USER} + fi fi TMPDIR=${TMPDIR:=/tmp} diff --git a/net-mgmt/netdisco/pkg-plist b/net-mgmt/netdisco/pkg-plist index 6e2e160e28ec..9a8519807cc2 100644 --- a/net-mgmt/netdisco/pkg-plist +++ b/net-mgmt/netdisco/pkg-plist @@ -1258,21 +1258,21 @@ bin/port_control %%WWWDIR%%/traceroute.html %%WWWDIR%%/valid-html401.png %%WWWDIR%%/vcss.gif +@unexec d="%D/etc/netdisco"; f="netdisco.conf"; if cmp -s ${d}/${f}.sample ${d}/${f}; then rm -f ${d}/${f}; fi; etc/netdisco/netdisco.conf.sample @exec if [ ! -f %D/etc/netdisco/netdisco.conf ] ; then cp -p %D/etc/netdisco/netdisco.conf.sample %D/etc/netdisco/netdisco.conf; fi -@unexec d="%D/etc/netdisco"; f="netdisco.conf"; if cmp -s ${d}/${f}.sample ${d}/${f}; then rm -f ${d}/${f}; fi; +@unexec d="%D/etc/netdisco"; f="netdisco-topology.txt"; if cmp -s ${d}/${f}.sample ${d}/${f}; then rm -f ${d}/${f}; fi; etc/netdisco/netdisco-topology.txt.sample @exec if [ ! -f %D/etc/netdisco/netdisco-topology.txt ] ; then cp -p %D/etc/netdisco/netdisco-topology.txt.sample %D/etc/netdisco/netdisco-topology.txt; fi -@unexec d="%D/etc/netdisco"; f="netdisco-topology.txt"; if cmp -s ${d}/${f}.sample ${d}/${f}; then rm -f ${d}/${f}; fi; +@unexec d="%D/etc/netdisco"; f="netdisco.crontab"; if cmp -s ${d}/${f}.sample ${d}/${f}; then rm -f ${d}/${f}; fi; etc/netdisco/netdisco.crontab.sample @exec if [ ! -f %D/etc/netdisco/netdisco.crontab ] ; then cp -p %D/etc/netdisco/netdisco.crontab.sample %D/etc/netdisco/netdisco.crontab; fi -@unexec d="%D/etc/netdisco"; f="netdisco.crontab"; if cmp -s ${d}/${f}.sample ${d}/${f}; then rm -f ${d}/${f}; fi; +@unexec d="%D/etc/netdisco"; f="netdisco_apache.conf"; if cmp -s ${d}/${f}.sample ${d}/${f}; then rm -f ${d}/${f}; fi; etc/netdisco/netdisco_apache.conf.sample @exec if [ ! -f %D/etc/netdisco/netdisco_apache.conf ] ; then cp -p %D/etc/netdisco/netdisco_apache.conf.sample %D/etc/netdisco/netdisco_apache.conf; fi -@unexec d="%D/etc/netdisco"; f="netdisco_apache.conf"; if cmp -s ${d}/${f}.sample ${d}/${f}; then rm -f ${d}/${f}; fi; +@unexec d="%D/etc/netdisco"; f="netdisco_apache_dir.conf"; if cmp -s ${d}/${f}.sample ${d}/${f}; then rm -f ${d}/${f}; fi; etc/netdisco/netdisco_apache_dir.conf.sample @exec if [ ! -f %D/etc/netdisco/netdisco_apache_dir.conf ] ; then cp -p %D/etc/netdisco/netdisco_apache_dir.conf.sample %D/etc/netdisco/netdisco_apache_dir.conf; fi -@unexec d="%D/etc/netdisco"; f="netdisco_apache_dir.conf"; if cmp -s ${d}/${f}.sample ${d}/${f}; then rm -f ${d}/${f}; fi; @dirrm %%WWWDIR%%/doc @exec mkdir -p %D/%%WWWDIR%%/mason @dirrm %%WWWDIR%%/mason