pkginstall framework: * Rewrite the mk/install/fonts script fragment as a scriptlet that's generated by the +INSTALL script during package installation. * Rename the FONTS_<TYPE>_DIRS variables to FONTS_DIRS.<type> to be more consistent with how "families" of variables are currently named in pkgsrc. * Rewrite mk/fonts.mk so that it's implemented in terms of the new functionality in the pkginstall framework. This file will be obsoleted in the near future after packages have been transitioned to use the new functionality in the pkginstall framework. Currently, packages will continue to work with no changes. Integrating the fonts-handling into the pkginstall framework has the benefit of generating a +FONTS scriptlet that may be run independently of the +INSTALL scripts to (idempotently) update the fonts databases and fix package installation errors.
76 lines
1.9 KiB
Bash
76 lines
1.9 KiB
Bash
# -*- sh -*-
|
|
# start of deinstall
|
|
#
|
|
# $NetBSD: deinstall,v 1.37 2005/12/29 03:44:38 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
|
|
#
|
|
# 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}
|
|
${TEST} ! -x ./+RCD_SCRIPTS ||
|
|
./+RCD_SCRIPTS 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}
|
|
#
|
|
# 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 ./+RCD_SCRIPTS ||
|
|
./+RCD_SCRIPTS CHECK-REMOVE ${PKG_METADATA_DIR}
|
|
${TEST} ! -x ./+DIRS ||
|
|
./+DIRS CHECK-REMOVE ${PKG_METADATA_DIR}
|
|
;;
|
|
esac
|
|
|
|
# end of deinstall
|