2d76049e1e
on platforms that need it. XXX Right now, if the platform needs it, then it runs for every package. XXX This needs to be fixed to only run for packages that install shared XXX libraries. * Move mk/plist/shlib-type to mk/scripts. * Move definition of SHLIB_TYPE from mk/plist/plist.mk to bsd.pkg.mk. * Move inclusion of bsd.pkginstall.mk below bsd.tools.mk so that it can use SHLIB_TYPE. This is necessary because SHLIB_TYPE's value is the result of evaluating a command, and the command needs "TOOL" definitions provided by bsd.tools.mk.
78 lines
1.9 KiB
Text
78 lines
1.9 KiB
Text
# $NetBSD: deinstall,v 1.2 2007/07/18 18:01:03 jlam Exp $
|
|
|
|
case ${STAGE} in
|
|
VIEW-DEINSTALL)
|
|
case ${_PKG_CONFIG} in
|
|
yes)
|
|
case ${PKG_SYSCONFDEPOTBASE} in
|
|
"")
|
|
${TEST} ! -x ./+FILES ||
|
|
./+FILES VIEW-REMOVE ${PREFIX} ${PKG_PREFIX}
|
|
;;
|
|
*)
|
|
${SETENV} PLIST_IGNORE_FILES="${CONF_IGNORE_FILES}" \
|
|
${LINKFARM} -D -t ${PKG_SYSCONFVIEWBASE} -d ${PKG_SYSCONFDEPOTBASE} ${PKGNAME}
|
|
${RMDIR} -p ${PKG_SYSCONFVIEWBASE} 2>/dev/null || ${TRUE}
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
#
|
|
# Unregister info files.
|
|
#
|
|
${TEST} ! -x ./+INFO_FILES ||
|
|
./+INFO_FILES REMOVE ${PKG_METADATA_DIR}
|
|
#
|
|
# Remove shells from /etc/shells.
|
|
#
|
|
${TEST} ! -x ./+SHELL ||
|
|
./+SHELL REMOVE ${PKG_METADATA_DIR}
|
|
${TEST} ! -x ./+SHELL ||
|
|
./+SHELL CHECK-REMOVE ${PKG_METADATA_DIR}
|
|
;;
|
|
|
|
DEINSTALL)
|
|
# Remove configuration files if they don't differ from the default
|
|
# config file.
|
|
#
|
|
${TEST} ! -x ./+FILES ||
|
|
./+FILES REMOVE ${PKG_METADATA_DIR}
|
|
;;
|
|
|
|
POST-DEINSTALL)
|
|
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
|
|
#
|
|
# Update any fonts databases.
|
|
#
|
|
${TEST} ! -x ./+FONTS ||
|
|
./+FONTS ${PKG_METADATA_DIR}
|
|
#
|
|
# Rebuild the system run-time library search path database.
|
|
#
|
|
${TEST} ! -x ./+SHLIBS ||
|
|
./+SHLIBS REMOVE ${PKG_METADATA_DIR}
|
|
#
|
|
# Remove empty directories and unused users/groups.
|
|
#
|
|
${TEST} ! -x ./+DIRS ||
|
|
./+DIRS REMOVE ${PKG_METADATA_DIR}
|
|
${TEST} ! -x ./+USERGROUP ||
|
|
./+USERGROUP REMOVE ${PKG_METADATA_DIR}
|
|
#
|
|
# Check for any existing bits after we're finished de-installing.
|
|
#
|
|
${TEST} ! -x ./+USERGROUP ||
|
|
./+USERGROUP CHECK-REMOVE ${PKG_METADATA_DIR}
|
|
${TEST} ! -x ./+FILES ||
|
|
./+FILES CHECK-REMOVE ${PKG_METADATA_DIR}
|
|
${TEST} ! -x ./+DIRS ||
|
|
./+DIRS CHECK-REMOVE ${PKG_METADATA_DIR}
|
|
;;
|
|
esac
|
|
|