head	1.5;
access;
symbols
	pkgsrc-2013Q2:1.5.0.54
	pkgsrc-2013Q2-base:1.5
	pkgsrc-2012Q4:1.5.0.52
	pkgsrc-2012Q4-base:1.5
	pkgsrc-2011Q4:1.5.0.50
	pkgsrc-2011Q4-base:1.5
	pkgsrc-2011Q2:1.5.0.48
	pkgsrc-2011Q2-base:1.5
	pkgsrc-2009Q4:1.5.0.46
	pkgsrc-2009Q4-base:1.5
	pkgsrc-2008Q4:1.5.0.44
	pkgsrc-2008Q4-base:1.5
	pkgsrc-2008Q3:1.5.0.42
	pkgsrc-2008Q3-base:1.5
	cube-native-xorg:1.5.0.40
	cube-native-xorg-base:1.5
	pkgsrc-2008Q2:1.5.0.38
	pkgsrc-2008Q2-base:1.5
	pkgsrc-2008Q1:1.5.0.36
	pkgsrc-2008Q1-base:1.5
	pkgsrc-2007Q4:1.5.0.34
	pkgsrc-2007Q4-base:1.5
	pkgsrc-2007Q3:1.5.0.32
	pkgsrc-2007Q3-base:1.5
	pkgsrc-2007Q2:1.5.0.30
	pkgsrc-2007Q2-base:1.5
	pkgsrc-2007Q1:1.5.0.28
	pkgsrc-2007Q1-base:1.5
	pkgsrc-2006Q4:1.5.0.26
	pkgsrc-2006Q4-base:1.5
	pkgsrc-2006Q3:1.5.0.24
	pkgsrc-2006Q3-base:1.5
	pkgsrc-2006Q2:1.5.0.22
	pkgsrc-2006Q2-base:1.5
	pkgsrc-2006Q1:1.5.0.20
	pkgsrc-2006Q1-base:1.5
	pkgsrc-2005Q4:1.5.0.18
	pkgsrc-2005Q4-base:1.5
	pkgsrc-2005Q3:1.5.0.16
	pkgsrc-2005Q3-base:1.5
	pkgsrc-2005Q2:1.5.0.14
	pkgsrc-2005Q2-base:1.5
	pkgsrc-2005Q1:1.5.0.12
	pkgsrc-2005Q1-base:1.5
	pkgsrc-2004Q4:1.5.0.10
	pkgsrc-2004Q4-base:1.5
	pkgsrc-2004Q3:1.5.0.8
	pkgsrc-2004Q3-base:1.5
	pkgsrc-2004Q2:1.5.0.6
	pkgsrc-2004Q2-base:1.5
	pkgsrc-2004Q1:1.5.0.4
	pkgsrc-2004Q1-base:1.5
	pkgsrc-2003Q4:1.5.0.2
	pkgsrc-2003Q4-base:1.5
	buildlink2-base:1.5;
locks; strict;
comment	@# @;


1.5
date	2001.11.19.16.23.16;	author jlam;	state dead;
branches;
next	1.4;

1.4
date	2001.11.06.23.12.00;	author jlam;	state Exp;
branches;
next	1.3;

1.3
date	2001.11.06.22.50.13;	author jlam;	state Exp;
branches;
next	1.2;

1.2
date	2001.11.06.10.58.03;	author jlam;	state Exp;
branches;
next	1.1;

1.1
date	2001.11.01.02.18.54;	author zuntum;	state Exp;
branches;
next	;


desc
@@


1.5
log
@Adapt to use shared INSTALL/DEINSTALL scripts by using the logic in
bsd.pkg.install.mk:

	* Remove old DEINSTALL/INSTALL scripts.
	* Move some text printed at POST-INSTALL time into the MESSAGE file.
	* Adjust rc.d scripts to respect rc.conf settings, so that the
	  script may be directly copied into /etc/rc.d.
@
text
@#!/bin/sh
#
# $NetBSD: DEINSTALL,v 1.4 2001/11/06 23:12:00 jlam Exp $

PKGNAME=$1
STAGE=$2

CAT="@@CAT@@"
CMP="@@CMP@@"
ECHO="@@ECHO@@"
RM="@@RM@@"
RMDIR="@@RMDIR@@"
TR="@@TR@@"
TRUE="@@TRUE@@"

SAMPLECONFDIR=${PKG_PREFIX}/share/examples/@@PKGBASE@@
CONFDIR=@@SURFRAW_SYSCONFDIR@@
MAKEDIRS=""

CONFFILES=" \
	${SAMPLECONFDIR}/surfraw.conf ${CONFDIR}/surfraw.conf : \
	${SAMPLECONFDIR}/surfraw_elvi.list ${CONFDIR}/surfraw_elvi.list \
	"

case ${STAGE} in
DEINSTALL)
	# Remove configuration files if they don't differ from the default
	# config file.
	#
	${ECHO} ${CONFFILES} | ${TR} ":" "\012" | while read SAMPLEFILE FILE
	do
		if ${CMP} -s ${FILE} ${SAMPLEFILE}
		then
			${RM} -f ${FILE}
		fi
	done
	;;

POST-DEINSTALL)
	modified_files=`						\
		${ECHO} ${CONFFILES} | ${TR} ":" "\012" |		\
		while read SAMPLEFILE FILE;				\
	  	do							\
			if [ -f ${FILE} ];				\
			then						\
				${ECHO} ${FILE};			\
			fi;						\
	  	done;							\
	`

	existing_dirs=''
	for dir in __dummy ${MAKEDIRS}
	do
		if [ "${dir}" != "__dummy" -a			\
		     "${dir}" != "/etc" -a			\
		     "${dir}" != "${PKG_PREFIX}/etc" ]
		then
			${RMDIR} -p ${dir} 2>/dev/null || ${TRUE}
			if [ -d ${dir} ]
			then
				existing_dirs="${existing_dirs} ${dir}"
			fi
		fi
	done

	if [ -n "${modified_files}" -o -n "${existing_dirs}" ]
	then
		${CAT} << EOF
===========================================================================
If you won't be using ${PKGNAME} any longer, you may want to remove
EOF
		if [ -n "${modified_files}" ]
		then
			${CAT} << EOF

  * the following files:

EOF
			for file in ${modified_files}
			do
				${ECHO} "	${file}"
			done
		fi
		if [ -n "${existing_dirs}" ]
		then
			${CAT} << EOF

* the following directories:

EOF
			for dir in ${existing_dirs}
			do
				${ECHO} "	${dir}"
			done
		fi
		${CAT} << EOF
===========================================================================
EOF
	fi
	;;

*)
	${ECHO} "Unexpected argument: ${STAGE}"
	exit 1
	;;
esac
exit 0
@


1.4
log
@Deal with scope issues: you can't modify a variable defined outside of a
subshell.  In this case, the subshell is implicit due to the pipeline.
@
text
@d3 1
a3 1
# $NetBSD: DEINSTALL,v 1.3 2001/11/06 22:50:13 jlam Exp $
@


1.3
log
@Properly check for remaining config files after deinstalling.
@
text
@d3 1
a3 1
# $NetBSD: DEINSTALL,v 1.2 2001/11/06 10:58:03 jlam Exp $
d40 10
a49 8
	modified_files=''
	${ECHO} ${CONFFILES} | ${TR} ":" "\012" | while read SAMPLEFILE FILE
	do
		if [ -f ${FILE} ]
		then
			modified_files="${modified_files} ${FILE}"
		fi
	done
@


1.2
log
@Update www/surfraw to 1.0.5.  Changes from version 1.0.3 include:

	Note that SURFRAW_browser was made obsolete in 1.0.4.
		SURFRAW_text_browser and SURFRAW_graphical_browser
		replace its functionality
	STATE EXTRA CLEARLY THE FORMAT OF ~/.surfraw.conf so
		even Redhat users get it.
	New elvi: debbugs, debcontents, debpackages, swhois, woffle
	Dead elvi: ircsearch, newscientist
	-g and -t switch between graphical & text browsers
	-new opens a new window on -remote comprehending browsers
	Fix url space escaping problem
@
text
@d3 1
a3 1
# $NetBSD: DEINSTALL,v 1.1 2001/11/01 02:18:54 zuntum Exp $
d41 1
a41 1
	for file in ${CONFFILES}
a42 1
		FILE=${CONFDIR}/${file}
@


1.1
log
@Move pkg/ files into package's toplevel directory
@
text
@d3 1
a3 1
# $NetBSD: DEINSTALL,v 1.4 2001/07/13 07:09:27 jlam Exp $
d10 1
d12 12
a23 4

SAMPLECONFDIR=${PKG_PREFIX}/etc
CONFDIR=${PKG_PREFIX}/etc
CONFFILES="surfraw.conf"
d30 1
a30 1
	for file in ${CONFFILES}
a31 2
		FILE=${CONFDIR}/${file}
		SAMPLEFILE=${SAMPLECONFDIR}/${file}.dist
d49 17
a65 1
	if [ -n "${modified_files}" ]
d70 6
a75 1
the following files:
d78 17
a94 4
		for file in ${modified_files}
		do
			echo "	${file}"
		done
d102 1
a102 1
	echo "Unexpected argument: ${STAGE}"
@

