From 399f83c52684953c1f0a9bb47fc6e1d31bf8e921 Mon Sep 17 00:00:00 2001 From: jlam Date: Wed, 17 Sep 2003 02:38:22 +0000 Subject: Introduce a new variable "CONF_DEPENDS" for pkgviews: a package's config directory matches the config directory for the dependency listed in CONF_DEPENDS. Use symlinks to physically point the package's config directory to the dependency's config directory, and handle all of this in the INSTALL/DEINSTALL scripts. Also make the INSTALL/DEINSTALL scripts a bit smarter about not copying files and not removing files if the source and destination file locations point to the same thing. --- mk/install/deinstall | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'mk/install/deinstall') diff --git a/mk/install/deinstall b/mk/install/deinstall index 84e70d14a3a..eed6f0533bc 100644 --- a/mk/install/deinstall +++ b/mk/install/deinstall @@ -1,6 +1,6 @@ # start of deinstall # -# $NetBSD: deinstall,v 1.21 2003/09/13 10:06:36 jlam Exp $ +# $NetBSD: deinstall,v 1.22 2003/09/17 02:38:29 jlam Exp $ eval set -- ${PKG_USERS} for userset; do @@ -116,7 +116,7 @@ DEINSTALL) samplefile="$1"; file="$2" shift; shift - if [ "${file}" != "${samplefile}" -a \ + if [ ! "${file}" -ef "${samplefile}" -a \ -e "${file}" -a -e "${samplefile}" ]; then if ${CMP} -s "${file}" "${samplefile}"; then ${RM} -f "${file}" @@ -138,6 +138,14 @@ POST-DEINSTALL) fi done + if [ "${PKG_INSTALLATION_TYPE}" = "pkgviews" -a \ + "${_PKG_CONFIG}" = "YES" -a -n "${CONF_DEPENDS}" ]; then + if [ -h ${PKG_SYSCONFDIR} ]; then + ${RM} -f ${PKG_SYSCONFDIR} + fi + ${RMDIR} -p `${DIRNAME} ${PKG_SYSCONFDIR}` 2>/dev/null || ${TRUE} + fi + existing_dirs='' eval set -- ${ALL_DIRS} for dir; do -- cgit v1.2.3