2007-07-18 20:01:02 +02:00
|
|
|
# $NetBSD: deinstall,v 1.2 2007/07/18 18:01:03 jlam Exp $
|
2001-11-19 17:18:44 +01:00
|
|
|
|
|
|
|
case ${STAGE} in
|
2003-09-02 08:59:37 +02:00
|
|
|
VIEW-DEINSTALL)
|
2005-02-02 11:33:01 +01:00
|
|
|
case ${_PKG_CONFIG} in
|
Define new variables for package Makefile use:
REQD_FILES, REQD_FILES_PERMS, REQD_FILES_MODE
REQD_DIRS, REQD_DIRS_PERMS
These are the same as the CONF_* variables, except the files and
directories listed in REQD_* are always copied over, created or removed
(taking into account if there are user modifications from the originals,
etc.) regardless of the value of PKG_CONFIG.
The implementation involved pushing the knowledge of PKG_CONFIG,
PKG_RCD_SCRIPTS, PKG_CREATE_USERGROUP, and PKG_REGISTER_SHELLS into
the individual helper scripts. The helper scripts are now always
invoked by the +INSTALL and +DEINSTALL scripts. The +DIRS and +FILES
script have been enhanced to understand a new "f" flag that means
"force" to ignore the value of PKG_CONFIG and PKG_RCD_SCRIPTS.
Lastly, the +FILES script has been taught a new "r" flag just for rc.d
scripts and the +RCD_SCRIPTS script is now unnecessary.
2005-08-20 00:24:09 +02:00
|
|
|
yes)
|
2005-02-02 11:33:01 +01:00
|
|
|
case ${PKG_SYSCONFDEPOTBASE} in
|
|
|
|
"")
|
2005-07-27 18:18:54 +02:00
|
|
|
${TEST} ! -x ./+FILES ||
|
2005-02-02 11:33:01 +01:00
|
|
|
./+FILES VIEW-REMOVE ${PREFIX} ${PKG_PREFIX}
|
|
|
|
;;
|
|
|
|
*)
|
2003-09-13 12:06:36 +02:00
|
|
|
${SETENV} PLIST_IGNORE_FILES="${CONF_IGNORE_FILES}" \
|
|
|
|
${LINKFARM} -D -t ${PKG_SYSCONFVIEWBASE} -d ${PKG_SYSCONFDEPOTBASE} ${PKGNAME}
|
2003-09-12 07:15:03 +02:00
|
|
|
${RMDIR} -p ${PKG_SYSCONFVIEWBASE} 2>/dev/null || ${TRUE}
|
2005-02-02 11:33:01 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
2005-07-29 20:32:17 +02:00
|
|
|
#
|
2006-03-09 01:20:27 +01:00
|
|
|
# Unregister info files.
|
|
|
|
#
|
|
|
|
${TEST} ! -x ./+INFO_FILES ||
|
|
|
|
./+INFO_FILES REMOVE ${PKG_METADATA_DIR}
|
|
|
|
#
|
2005-07-29 20:32:17 +02:00
|
|
|
# Remove shells from /etc/shells.
|
|
|
|
#
|
Define new variables for package Makefile use:
REQD_FILES, REQD_FILES_PERMS, REQD_FILES_MODE
REQD_DIRS, REQD_DIRS_PERMS
These are the same as the CONF_* variables, except the files and
directories listed in REQD_* are always copied over, created or removed
(taking into account if there are user modifications from the originals,
etc.) regardless of the value of PKG_CONFIG.
The implementation involved pushing the knowledge of PKG_CONFIG,
PKG_RCD_SCRIPTS, PKG_CREATE_USERGROUP, and PKG_REGISTER_SHELLS into
the individual helper scripts. The helper scripts are now always
invoked by the +INSTALL and +DEINSTALL scripts. The +DIRS and +FILES
script have been enhanced to understand a new "f" flag that means
"force" to ignore the value of PKG_CONFIG and PKG_RCD_SCRIPTS.
Lastly, the +FILES script has been taught a new "r" flag just for rc.d
scripts and the +RCD_SCRIPTS script is now unnecessary.
2005-08-20 00:24:09 +02:00
|
|
|
${TEST} ! -x ./+SHELL ||
|
|
|
|
./+SHELL REMOVE ${PKG_METADATA_DIR}
|
2005-07-29 20:32:17 +02:00
|
|
|
${TEST} ! -x ./+SHELL ||
|
|
|
|
./+SHELL CHECK-REMOVE ${PKG_METADATA_DIR}
|
2003-09-02 08:59:37 +02:00
|
|
|
;;
|
|
|
|
|
2001-11-19 17:18:44 +01:00
|
|
|
DEINSTALL)
|
|
|
|
# Remove configuration files if they don't differ from the default
|
|
|
|
# config file.
|
|
|
|
#
|
Define new variables for package Makefile use:
REQD_FILES, REQD_FILES_PERMS, REQD_FILES_MODE
REQD_DIRS, REQD_DIRS_PERMS
These are the same as the CONF_* variables, except the files and
directories listed in REQD_* are always copied over, created or removed
(taking into account if there are user modifications from the originals,
etc.) regardless of the value of PKG_CONFIG.
The implementation involved pushing the knowledge of PKG_CONFIG,
PKG_RCD_SCRIPTS, PKG_CREATE_USERGROUP, and PKG_REGISTER_SHELLS into
the individual helper scripts. The helper scripts are now always
invoked by the +INSTALL and +DEINSTALL scripts. The +DIRS and +FILES
script have been enhanced to understand a new "f" flag that means
"force" to ignore the value of PKG_CONFIG and PKG_RCD_SCRIPTS.
Lastly, the +FILES script has been taught a new "r" flag just for rc.d
scripts and the +RCD_SCRIPTS script is now unnecessary.
2005-08-20 00:24:09 +02:00
|
|
|
${TEST} ! -x ./+FILES ||
|
|
|
|
./+FILES REMOVE ${PKG_METADATA_DIR}
|
2001-11-19 17:18:44 +01:00
|
|
|
;;
|
|
|
|
|
|
|
|
POST-DEINSTALL)
|
2003-09-17 04:38:22 +02:00
|
|
|
if [ "${PKG_INSTALLATION_TYPE}" = "pkgviews" -a \
|
Define new variables for package Makefile use:
REQD_FILES, REQD_FILES_PERMS, REQD_FILES_MODE
REQD_DIRS, REQD_DIRS_PERMS
These are the same as the CONF_* variables, except the files and
directories listed in REQD_* are always copied over, created or removed
(taking into account if there are user modifications from the originals,
etc.) regardless of the value of PKG_CONFIG.
The implementation involved pushing the knowledge of PKG_CONFIG,
PKG_RCD_SCRIPTS, PKG_CREATE_USERGROUP, and PKG_REGISTER_SHELLS into
the individual helper scripts. The helper scripts are now always
invoked by the +INSTALL and +DEINSTALL scripts. The +DIRS and +FILES
script have been enhanced to understand a new "f" flag that means
"force" to ignore the value of PKG_CONFIG and PKG_RCD_SCRIPTS.
Lastly, the +FILES script has been taught a new "r" flag just for rc.d
scripts and the +RCD_SCRIPTS script is now unnecessary.
2005-08-20 00:24:09 +02:00
|
|
|
"${_PKG_CONFIG}" = "yes" -a -n "${CONF_DEPENDS}" ]; then
|
2003-09-17 04:38:22 +02:00
|
|
|
if [ -h ${PKG_SYSCONFDIR} ]; then
|
|
|
|
${RM} -f ${PKG_SYSCONFDIR}
|
|
|
|
fi
|
|
|
|
${RMDIR} -p `${DIRNAME} ${PKG_SYSCONFDIR}` 2>/dev/null || ${TRUE}
|
|
|
|
fi
|
2005-02-02 11:33:01 +01:00
|
|
|
#
|
2005-12-29 04:44:38 +01:00
|
|
|
# Update any fonts databases.
|
|
|
|
#
|
|
|
|
${TEST} ! -x ./+FONTS ||
|
|
|
|
./+FONTS ${PKG_METADATA_DIR}
|
|
|
|
#
|
2007-07-18 20:01:02 +02:00
|
|
|
# Rebuild the system run-time library search path database.
|
|
|
|
#
|
|
|
|
${TEST} ! -x ./+SHLIBS ||
|
|
|
|
./+SHLIBS REMOVE ${PKG_METADATA_DIR}
|
|
|
|
#
|
2005-02-02 11:33:01 +01:00
|
|
|
# Remove empty directories and unused users/groups.
|
|
|
|
#
|
Define new variables for package Makefile use:
REQD_FILES, REQD_FILES_PERMS, REQD_FILES_MODE
REQD_DIRS, REQD_DIRS_PERMS
These are the same as the CONF_* variables, except the files and
directories listed in REQD_* are always copied over, created or removed
(taking into account if there are user modifications from the originals,
etc.) regardless of the value of PKG_CONFIG.
The implementation involved pushing the knowledge of PKG_CONFIG,
PKG_RCD_SCRIPTS, PKG_CREATE_USERGROUP, and PKG_REGISTER_SHELLS into
the individual helper scripts. The helper scripts are now always
invoked by the +INSTALL and +DEINSTALL scripts. The +DIRS and +FILES
script have been enhanced to understand a new "f" flag that means
"force" to ignore the value of PKG_CONFIG and PKG_RCD_SCRIPTS.
Lastly, the +FILES script has been taught a new "r" flag just for rc.d
scripts and the +RCD_SCRIPTS script is now unnecessary.
2005-08-20 00:24:09 +02:00
|
|
|
${TEST} ! -x ./+DIRS ||
|
|
|
|
./+DIRS REMOVE ${PKG_METADATA_DIR}
|
|
|
|
${TEST} ! -x ./+USERGROUP ||
|
|
|
|
./+USERGROUP REMOVE ${PKG_METADATA_DIR}
|
2005-02-02 11:33:01 +01:00
|
|
|
#
|
|
|
|
# Check for any existing bits after we're finished de-installing.
|
|
|
|
#
|
2005-07-27 18:18:54 +02:00
|
|
|
${TEST} ! -x ./+USERGROUP ||
|
2005-02-02 11:33:01 +01:00
|
|
|
./+USERGROUP CHECK-REMOVE ${PKG_METADATA_DIR}
|
2005-07-27 18:18:54 +02:00
|
|
|
${TEST} ! -x ./+FILES ||
|
2005-02-02 11:33:01 +01:00
|
|
|
./+FILES CHECK-REMOVE ${PKG_METADATA_DIR}
|
2005-07-27 18:18:54 +02:00
|
|
|
${TEST} ! -x ./+DIRS ||
|
2005-02-02 11:33:01 +01:00
|
|
|
./+DIRS CHECK-REMOVE ${PKG_METADATA_DIR}
|
2001-11-19 17:18:44 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|