pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/pkginstall After a package is installed, make sure ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/260072684678
branches:  trunk
changeset: 535616:260072684678
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Nov 23 11:36:19 2007 +0000

description:
After a package is installed, make sure that the example files for
CONF_FILES and similar exist, since the pkginstall framework skips them
silently, which is not a good idea.

For example I just installed dovecot, and there was neither a
configuration file installed nor a message that a configuration file
exists at all.

diffstat:

 mk/pkginstall/bsd.pkginstall.mk |  37 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 36 insertions(+), 1 deletions(-)

diffs (51 lines):

diff -r f96b20f13712 -r 260072684678 mk/pkginstall/bsd.pkginstall.mk
--- a/mk/pkginstall/bsd.pkginstall.mk   Fri Nov 23 09:51:38 2007 +0000
+++ b/mk/pkginstall/bsd.pkginstall.mk   Fri Nov 23 11:36:19 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkginstall.mk,v 1.34 2007/10/10 11:42:36 rillig Exp $
+# $NetBSD: bsd.pkginstall.mk,v 1.35 2007/11/23 11:36:19 rillig Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and implements the
 # common INSTALL/DEINSTALL scripts framework.  To use the pkginstall
@@ -413,6 +413,41 @@
 _INSTALL_UNPACK_TMPL+=         ${_INSTALL_FILES_FILE}
 _INSTALL_DATA_TMPL+=           ${_INSTALL_FILES_DATAFILE}
 
+privileged-install-hook: _pkginstall-postinstall-check
+_pkginstall-postinstall-check: .PHONY
+       ${RUN} p="${DESTDIR}${PREFIX}";                                 \
+       ${_FUNC_STRIP_PREFIX};                                          \
+       set args ${RCD_SCRIPTS}; shift;                                 \
+       while [ $$# -gt 0 ]; do                                         \
+               egfile=$$p/`strip_prefix "${RCD_SCRIPTS_EXAMPLEDIR}/$$1"`; \
+               shift 1;                                                \
+               [ -f "$$egfile" ] || ${FAIL_MSG} "RCD_SCRIPT $$egfile does not exist."; \
+       done;                                                           \
+       set args ${CONF_FILES}; shift;                                  \
+       while [ $$# -gt 0 ]; do                                         \
+               egfile=$$p/`strip_prefix "$$1"`;                        \
+               shift 2;                                                \
+               [ -f "$$1" ] || ${FAIL_MSG} "CONF_FILE $$egfile does not exist."; \
+       done;                                                           \
+       set args ${REQD_FILES}; shift;                                  \
+       while [ $$# -gt 0 ]; do                                         \
+               egfile=$$p/`strip_prefix "$$1"`;                        \
+               shift 2;                                                \
+               [ -f "$$1" ] || ${FAIL_MSG} "REQD_FILE $$egfile does not exist."; \
+       done;                                                           \
+       set args ${CONF_FILES_PERMS}; shift;                            \
+       while [ $$# -gt 0 ]; do                                         \
+               egfile=$$p/`strip_prefix "$$1"`;                        \
+               shift 5;                                                \
+               [ -f "$$1" ] || ${FAIL_MSG} "CONF_FILES_PERMS $$egfile does not exist."; \
+       done;                                                           \
+       set args ${REQD_FILES_PERMS}; shift;                            \
+       while [ $$# -gt 0 ]; do                                         \
+               egfile=$$p/`strip_prefix "$$1"`;                        \
+               shift 5;                                                \
+               [ -f "$$1" ] || ${FAIL_MSG} "REQD_FILES_PERMS $$egfile does not exist."; \
+       done
+
 ${_INSTALL_FILES_DATAFILE}:
        ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
        ${_PKG_SILENT}${_PKG_DEBUG}${_FUNC_STRIP_PREFIX};               \



Home | Main Index | Thread Index | Old Index