summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2003-11-23 07:14:43 +0000
committerjlam <jlam@pkgsrc.org>2003-11-23 07:14:43 +0000
commite36b264d9d145965e3cb2ef8d1e78e777fe396c5 (patch)
treec208aee6f38a73fe2cc0863c78bf9907c1b269e6
parentd474607ea12c2f434208348b599003ea45a5ad2a (diff)
downloadpkgsrc-e36b264d9d145965e3cb2ef8d1e78e777fe396c5.tar.gz
In the overwrite package case:
* Ensure that VIEW-INSTALL is called after _all_ POST-INSTALL actions (including any in the INSTALL_EXTRA_TMPL file) by moving the call to a file that is included after all other INSTALL templates. * Ensure that VIEW-DEINSTALL is called before _all_ DEINSTALL actions (including any in the DEINSTALL_EXTRA_TMPL file) by moving the call to a file that is included before all other DEINSTALL templates.
-rw-r--r--mk/bsd.pkg.install.mk6
-rw-r--r--mk/install/deinstall7
-rw-r--r--mk/install/deinstall-pre18
-rw-r--r--mk/install/install6
-rw-r--r--mk/install/install-post18
5 files changed, 43 insertions, 12 deletions
diff --git a/mk/bsd.pkg.install.mk b/mk/bsd.pkg.install.mk
index 63aba11b8a3..9d670a0fb62 100644
--- a/mk/bsd.pkg.install.mk
+++ b/mk/bsd.pkg.install.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.install.mk,v 1.52 2003/09/17 02:38:22 jlam Exp $
+# $NetBSD: bsd.pkg.install.mk,v 1.53 2003/11/23 07:14:43 jlam Exp $
#
# This Makefile fragment is included by package Makefiles to use the common
# INSTALL/DEINSTALL scripts. To use this Makefile fragment, simply:
@@ -30,10 +30,12 @@ HEADER_EXTRA_TMPL?= ${.CURDIR}/HEADER
.else
HEADER_EXTRA_TMPL?= # empty
.endif
+DEINSTALL_PRE_TMPL?= ${.CURDIR}/../../mk/install/deinstall-pre
DEINSTALL_EXTRA_TMPL?= # empty
DEINSTALL_TMPL?= ${.CURDIR}/../../mk/install/deinstall
INSTALL_TMPL?= ${.CURDIR}/../../mk/install/install
INSTALL_EXTRA_TMPL?= # empty
+INSTALL_POST_TMPL?= ${.CURDIR}/../../mk/install/install-post
_FOOTER_TMPL?= ${.CURDIR}/../../mk/install/footer
# DEINSTALL_TEMPLATES and INSTALL_TEMPLATES are the default list of source
@@ -41,6 +43,7 @@ _FOOTER_TMPL?= ${.CURDIR}/../../mk/install/footer
#
DEINSTALL_TEMPLATES= ${_HEADER_TMPL}
DEINSTALL_TEMPLATES+= ${HEADER_EXTRA_TMPL}
+DEINSTALL_TEMPLATES+= ${DEINSTALL_PRE_TMPL}
DEINSTALL_TEMPLATES+= ${DEINSTALL_EXTRA_TMPL}
DEINSTALL_TEMPLATES+= ${DEINSTALL_TMPL}
DEINSTALL_TEMPLATES+= ${_FOOTER_TMPL}
@@ -48,6 +51,7 @@ INSTALL_TEMPLATES= ${_HEADER_TMPL}
INSTALL_TEMPLATES+= ${HEADER_EXTRA_TMPL}
INSTALL_TEMPLATES+= ${INSTALL_TMPL}
INSTALL_TEMPLATES+= ${INSTALL_EXTRA_TMPL}
+INSTALL_TEMPLATES+= ${INSTALL_POST_TMPL}
INSTALL_TEMPLATES+= ${_FOOTER_TMPL}
# These are the list of source files that are concatenated to form the
diff --git a/mk/install/deinstall b/mk/install/deinstall
index 0fd570c3fc5..71bce248e18 100644
--- a/mk/install/deinstall
+++ b/mk/install/deinstall
@@ -1,6 +1,6 @@
# start of deinstall
#
-# $NetBSD: deinstall,v 1.24 2003/11/21 10:54:14 jlam Exp $
+# $NetBSD: deinstall,v 1.25 2003/11/23 07:14:43 jlam Exp $
eval set -- ${PKG_USERS}
for userset; do
@@ -101,11 +101,6 @@ VIEW-DEINSTALL)
;;
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.
#
diff --git a/mk/install/deinstall-pre b/mk/install/deinstall-pre
new file mode 100644
index 00000000000..b3656bdf4e5
--- /dev/null
+++ b/mk/install/deinstall-pre
@@ -0,0 +1,18 @@
+# start of deinstall-pre
+#
+# $NetBSD: deinstall-pre,v 1.1 2003/11/23 07:14:43 jlam Exp $
+
+# Ensure that the VIEW-DEINSTALL action is called for overwrite packages.
+# This is here to ensure that it's the first DEINSTALL action (before
+# any DEINSTALL_EXTRA_TMPL DEINSTALL actions).
+#
+case ${STAGE} in
+DEINSTALL)
+ if [ "${PKG_INSTALLATION_TYPE}" = "overwrite" ]; then
+ ${SETENV} PKG_PREFIX="${PKG_PREFIX}" \
+ $0 ${PKGNAME} VIEW-DEINSTALL
+ fi
+ ;;
+esac
+
+# end of deinstall-pre
diff --git a/mk/install/install b/mk/install/install
index 9554a456504..9a8f3f37983 100644
--- a/mk/install/install
+++ b/mk/install/install
@@ -1,6 +1,6 @@
# start of install
#
-# $NetBSD: install,v 1.27 2003/11/21 10:32:25 jlam Exp $
+# $NetBSD: install,v 1.28 2003/11/23 07:14:43 jlam Exp $
if [ -z "${CONF_FILES}" -a -z "${CONF_FILES_PERMS}" -a \
-z "${SUPPORT_FILES}" -a -z "${SUPPORT_FILES_PERMS}" -o \
@@ -386,10 +386,6 @@ EOF
EOF
fi
fi
- if [ "${PKG_INSTALLATION_TYPE}" = "overwrite" ]; then
- ${SETENV} PKG_PREFIX="${PKG_PREFIX}" \
- $0 ${PKGNAME} VIEW-INSTALL
- fi
;;
VIEW-INSTALL)
diff --git a/mk/install/install-post b/mk/install/install-post
new file mode 100644
index 00000000000..d8b25c5a021
--- /dev/null
+++ b/mk/install/install-post
@@ -0,0 +1,18 @@
+# start of install-post
+#
+# $NetBSD: install-post,v 1.1 2003/11/23 07:14:43 jlam Exp $
+
+# Ensure that the VIEW-INSTALL action is called for overwrite packages.
+# This is here to ensure that it's the final POST-INSTALL action (after
+# any INSTALL_EXTRA_TMPL POST-INSTALL actions).
+#
+case ${STAGE} in
+POST-INSTALL)
+ if [ "${PKG_INSTALLATION_TYPE}" = "overwrite" ]; then
+ ${SETENV} PKG_PREFIX="${PKG_PREFIX}" \
+ $0 ${PKGNAME} VIEW-INSTALL
+ fi
+ ;;
+esac
+
+# end of install-post