diff options
author | jlam <jlam@pkgsrc.org> | 2003-09-02 06:59:37 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2003-09-02 06:59:37 +0000 |
commit | 841b57441b803acb6edd290521d4343593e7e175 (patch) | |
tree | 84e91cd88c93c01f847527b25d244510cb5b95db /mk/install/deinstall | |
parent | 97e17132ab11f03e7cfe511b3e6188812a6c47e4 (diff) | |
download | pkgsrc-841b57441b803acb6edd290521d4343593e7e175.tar.gz |
Merge pkgviews-mk branch into the HEAD by running:
cd pkgsrc/mk
cvs update -Pd -A
cvs update -Pd -j pkgviews-mk-base -j pkgviews-mk
Diffstat (limited to 'mk/install/deinstall')
-rw-r--r-- | mk/install/deinstall | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/mk/install/deinstall b/mk/install/deinstall index a0e041b7725..470c5ffc811 100644 --- a/mk/install/deinstall +++ b/mk/install/deinstall @@ -1,6 +1,6 @@ # start of deinstall # -# $NetBSD: deinstall,v 1.17 2003/05/06 17:42:04 jmmv Exp $ +# $NetBSD: deinstall,v 1.18 2003/09/02 07:00:06 jlam Exp $ eval set -- ${PKG_USERS} for userset; do @@ -22,8 +22,11 @@ for groupset; do done eval set -- ${CONF_FILES} ${SUPPORT_FILES} -for file; do - ALL_FILES="${ALL_FILES} \"${file}\"" +while [ $# -gt 0 ]; do + samplefile="$1"; file="$2" + shift; shift + ALL_FILES="${ALL_FILES} \"${samplefile}\" \"${file}\"" + VIEW_FILES="${VIEW_FILES} \"${file}\"" done if [ "${_PKG_RCD_SCRIPTS}" = "YES" ]; then eval set -- ${RCD_SCRIPTS} @@ -39,6 +42,7 @@ while [ $# -gt 0 ]; do samplefile="$1"; file="$2"; owner="$3"; group="$4"; mode="$5" shift; shift; shift; shift; shift ALL_FILES="${ALL_FILES} \"${samplefile}\" \"${file}\"" + VIEW_FILES="${VIEW_FILES} \"${file}\"" done eval set -- ${RCD_SCRIPTS_DIR} ${MAKE_DIRS} @@ -70,7 +74,37 @@ ALL_DIRS=` ` case ${STAGE} in +VIEW-DEINSTALL) + if [ "${_PKG_CONFIG}" = "YES" -a \ + -n "${PKG_SYSCONFVIEWBASE}" -a -n "${VIEW_FILES}" ]; then + if [ -n "${PKG_SYSCONFDEPOTBASE}" ]; then + ${LINKFARM} -D -t ${PKG_SYSCONFVIEWBASE} -d ${PKG_SYSCONFDEPOTBASE} ${PKGNAME} + else + eval set -- ${VIEW_FILES} + for file; do + link=`${ECHO} ${file} | ${SED} "s,^${PREFIX}/,${PKG_PREFIX}/,"` + dir=`${DIRNAME} ${link}` + if [ -h "${link}" ]; then + ${RM} -f ${link} + ${RMDIR} -p ${dir} 2>/dev/null || ${TRUE} + fi + done + fi + fi + if [ -n "${PKG_SHELL}" -a "${PKG_REGISTER_SHELLS}" = "YES" ]; then + ${ECHO} "===> Updating /etc/shells" + ${CP} /etc/shells /etc/shells.pkgsrc."$$" + (${GREP} -v ${PKG_SHELL} /etc/shells.pkgsrc."$$" || ${TRUE}) > /etc/shells + ${RM} /etc/shells.pkgsrc."$$" + fi + ;; + DEINSTALL) + if [ "${PKG_INSTALLATION_TYPE}" = "overwrite" ]; then + ${SETENV} PKG_PREFIX="${PKG_PREFIX}" \ + $0 ${PKGNAME} VIEW-DEINSTALL + fi + # Remove configuration files if they don't differ from the default # config file. # @@ -88,12 +122,6 @@ DEINSTALL) fi done fi - if [ -n "${PKG_SHELL}" -a "${PKG_REGISTER_SHELLS}" = "YES" ]; then - ${ECHO} "===> Updating /etc/shells" - ${CP} /etc/shells /etc/shells.pkgsrc."$$" - (${GREP} -v ${PKG_SHELL} /etc/shells.pkgsrc."$$" || ${TRUE}) > /etc/shells - ${RM} /etc/shells.pkgsrc."$$" - fi ;; POST-DEINSTALL) @@ -216,11 +244,6 @@ EOF EOF fi ;; - -*) - ${ECHO} "Unexpected argument: ${STAGE}" - exit 1 - ;; esac # end of deinstall |