Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/postinstall fix the sendmail, mailerconf and atf ch...



details:   https://anonhg.NetBSD.org/src/rev/48d7b282a45c
branches:  trunk
changeset: 770170:48d7b282a45c
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Oct 07 02:07:56 2011 +0000

description:
fix the sendmail, mailerconf and atf checks to use ${DEST_DIR}.
add a note about this to the top of the file.

diffstat:

 usr.sbin/postinstall/postinstall |  24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diffs (69 lines):

diff -r 38481dccb9e6 -r 48d7b282a45c usr.sbin/postinstall/postinstall
--- a/usr.sbin/postinstall/postinstall  Thu Oct 06 22:25:00 2011 +0000
+++ b/usr.sbin/postinstall/postinstall  Fri Oct 07 02:07:56 2011 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.125 2011/09/06 21:39:30 jym Exp $
+# $NetBSD: postinstall,v 1.126 2011/10/07 02:07:56 mrg Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -35,6 +35,10 @@
 #
 
 #
+# XXX BE SURE TO USE ${DEST_DIR} PREFIX BEFORE ALL REAL FILE OPERATIONS XXX
+#
+
+#
 # checks to add:
 #      - sysctl(8) renames (net.inet6.ip6.bindv6only -> net.inet6.ip6.v6only)
 #      - de* -> tlp* migration (/etc/ifconfig.de*, $ifconfig_de*,
@@ -1218,9 +1222,11 @@
        for f in /etc/mail/helpfile /etc/mail/local-host-names \
            /etc/mail/sendmail.cf /etc/mail/submit.cf /etc/rc.d/sendmail \
            /etc/rc.d/smmsp /usr/share/misc/sendmail.hf \
-           $(find /usr/share/sendmail -type f) \
-           $(find /usr/share/sendmail -type d) /var/log/sendmail.st \
-           /var/spool/clientmqueue /var/spool/mqueue; do
+           $(find ${DEST_DIR}/usr/share/sendmail -type f) \
+           $(find ${DEST_DIR}/usr/share/sendmail -type d) \
+           ${DEST_DIR}/var/log/sendmail.st \
+           ${DEST_DIR}/var/spool/clientmqueue \
+           ${DEST_DIR}/var/spool/mqueue; do
                [ -e "${DEST_DIR}${f}" ] && echo "${f}"
        done | obsolete_paths "${op}"
        failed=$(( ${failed} + $? ))
@@ -1238,7 +1244,7 @@
        op="$1"
 
        failed=0
-       mta_path="$(${AWK} '/^sendmail[ \t]/{print$2}' /etc/mailer.conf)"
+       mta_path="$(${AWK} '/^sendmail[ \t]/{print$2}' ${DEST_DIR}/etc/mailer.conf)"
        old_sendmail_path="/usr/libexec/sendmail/sendmail"
        if [ "${mta_path}" = "${old_sendmail_path}" ]; then
            if [ "$op" = check ]; then
@@ -1556,18 +1562,18 @@
        op="$1"
        failed=0
 
-       if grep '[^#]*unprivileged-user[ \t]*=.*_atf' /etc/atf/common.conf \
+       if grep '[^#]*unprivileged-user[ \t]*=.*_atf' ${DEST_DIR}/etc/atf/common.conf \
            >/dev/null
        then
                if [ "$1" = "fix" ]; then
                        sed -e \
                            "/[^#]*unprivileged-user[\ t]*=/s/_atf/_tests/" \
-                           /etc/atf/common.conf >/etc/atf/common.conf.new
+                           ${DEST_DIR}/etc/atf/common.conf >${DEST_DIR}/etc/atf/common.conf.new
                        failed=$(( ${failed} + $? ))
-                       mv /etc/atf/common.conf.new /etc/atf/common.conf
+                       mv ${DEST_DIR}/etc/atf/common.conf.new ${DEST_DIR}/etc/atf/common.conf
                        failed=$(( ${failed} + $? ))
                else
-                       msg "unprivileged-user=_atf in /etc/atf/common.conf" \
+                       msg "unprivileged-user=_atf in ${DEST_DIR}/etc/atf/common.conf" \
                            "should be _tests"
                        failed=1
                fi



Home | Main Index | Thread Index | Old Index