summaryrefslogtreecommitdiff
path: root/mk/install/deinstall
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2005-07-27 16:18:54 +0000
committerjlam <jlam@pkgsrc.org>2005-07-27 16:18:54 +0000
commit3de5d86818dd43e795076526d9e986a5d15da35c (patch)
tree9b9f04a9c23a5f49002db90799835420a87cf343 /mk/install/deinstall
parentfb823c47c7a3ca94b01559dbbc6cb58fd32f9ffa (diff)
downloadpkgsrc-3de5d86818dd43e795076526d9e986a5d15da35c.tar.gz
Rewrite scripts to be more resilient to shells that exit immediately
if an untested command fails (see sh(1), "-e errexit"). Do this by changing lines that look like: test expression && command to test ! expression || command so that the statement list always returns 0. Also, back out revision 1.38 of pkgsrc/mk/install/install and modify the if-test to branch correctly if +USERGROUP doesn't exist.
Diffstat (limited to 'mk/install/deinstall')
-rw-r--r--mk/install/deinstall20
1 files changed, 10 insertions, 10 deletions
diff --git a/mk/install/deinstall b/mk/install/deinstall
index 9da0281929d..26f51d0b18a 100644
--- a/mk/install/deinstall
+++ b/mk/install/deinstall
@@ -1,7 +1,7 @@
# -*- sh -*-
# start of deinstall
#
-# $NetBSD: deinstall,v 1.33 2005/03/21 19:29:46 wiz Exp $
+# $NetBSD: deinstall,v 1.34 2005/07/27 16:18:54 jlam Exp $
case ${STAGE} in
VIEW-DEINSTALL)
@@ -9,7 +9,7 @@ VIEW-DEINSTALL)
YES)
case ${PKG_SYSCONFDEPOTBASE} in
"")
- ${TEST} -x ./+FILES &&
+ ${TEST} ! -x ./+FILES ||
./+FILES VIEW-REMOVE ${PREFIX} ${PKG_PREFIX}
;;
*)
@@ -33,11 +33,11 @@ DEINSTALL)
# config file.
#
case ${_PKG_CONFIG} in
- YES) ${TEST} -x ./+FILES &&
+ YES) ${TEST} ! -x ./+FILES ||
./+FILES REMOVE ${PKG_METADATA_DIR} ;;
esac
case ${_PKG_CONFIG}${_PKG_RCD_SCRIPTS} in
- YESYES) ${TEST} -x ./+RCD_SCRIPTS &&
+ YESYES) ${TEST} ! -x ./+RCD_SCRIPTS ||
./+RCD_SCRIPTS REMOVE ${PKG_METADATA_DIR} ;;
esac
;;
@@ -54,23 +54,23 @@ POST-DEINSTALL)
# Remove empty directories and unused users/groups.
#
case ${_PKG_CONFIG} in
- YES) ${TEST} -x ./+DIRS &&
+ YES) ${TEST} ! -x ./+DIRS ||
./+DIRS REMOVE ${PKG_METADATA_DIR} ;;
esac
case ${_PKG_CREATE_USERGROUP} in
- YES) ${TEST} -x ./+USERGROUP &&
+ YES) ${TEST} ! -x ./+USERGROUP ||
./+USERGROUP REMOVE ${PKG_METADATA_DIR} ;;
esac
#
# Check for any existing bits after we're finished de-installing.
#
- ${TEST} -x ./+USERGROUP &&
+ ${TEST} ! -x ./+USERGROUP ||
./+USERGROUP CHECK-REMOVE ${PKG_METADATA_DIR}
- ${TEST} -x ./+FILES &&
+ ${TEST} ! -x ./+FILES ||
./+FILES CHECK-REMOVE ${PKG_METADATA_DIR}
- ${TEST} -x ./+RCD_SCRIPTS &&
+ ${TEST} ! -x ./+RCD_SCRIPTS ||
./+RCD_SCRIPTS CHECK-REMOVE ${PKG_METADATA_DIR}
- ${TEST} -x ./+DIRS &&
+ ${TEST} ! -x ./+DIRS ||
./+DIRS CHECK-REMOVE ${PKG_METADATA_DIR}
;;
esac