Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/postinstall quote SRC_DIR and DEST_DIR everywhere. ...



details:   https://anonhg.NetBSD.org/src/rev/e8991adbc34e
branches:  trunk
changeset: 777539:e8991adbc34e
user:      apb <apb%NetBSD.org@localhost>
date:      Wed Feb 22 16:42:07 2012 +0000

description:
quote SRC_DIR and DEST_DIR everywhere.  Also wrap some long lines.

diffstat:

 usr.sbin/postinstall/postinstall |  50 +++++++++++++++++++++++----------------
 1 files changed, 29 insertions(+), 21 deletions(-)

diffs (126 lines):

diff -r 636c5c3dff4b -r e8991adbc34e usr.sbin/postinstall/postinstall
--- a/usr.sbin/postinstall/postinstall  Wed Feb 22 16:27:38 2012 +0000
+++ b/usr.sbin/postinstall/postinstall  Wed Feb 22 16:42:07 2012 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.133 2012/02/22 16:27:38 apb Exp $
+# $NetBSD: postinstall,v 1.134 2012/02/22 16:42:07 apb Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1023,7 +1023,7 @@
        if ! $SOURCEMODE; then
                MTREE_DIR="${SRC_DIR}/etc/mtree"
        else
-               ${MAKE} -C ${SRC_DIR}/etc/mtree emit_dist_file > \
+               ${MAKE} -C "${SRC_DIR}/etc/mtree" emit_dist_file > \
                    "${SCRATCHDIR}/NetBSD.dist"
                MTREE_DIR="${SCRATCHDIR}"
        fi
@@ -1125,7 +1125,7 @@
        # because we don't expect "postinstall fix pwd_mkdb" to be
        # invoked during a cross build.
 
-       set -- $(${DB} -q -Sb -Ub -To -N hash ${DEST_DIR}/etc/pwd.db \
+       set -- $(${DB} -q -Sb -Ub -To -N hash "${DEST_DIR}/etc/pwd.db" \
                'VERSION\0')
        case "$2" in
        '\001\000\000\000') return 0 ;; # version 1, little-endian
@@ -1135,7 +1135,9 @@
        if [ "${op}" = "check" ]; then
                msg "Update format of passwd database"
                failed=1
-       elif ! ${PWD_MKDB} -V 1 -d ${DEST_DIR:-/} ${DEST_DIR}/etc/master.passwd; then
+       elif ! ${PWD_MKDB} -V 1 -d "${DEST_DIR:-/}" \
+                       "${DEST_DIR}/etc/master.passwd";
+       then
                msg "Can't update format of passwd database"
                failed=1
        else
@@ -1262,11 +1264,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 ${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
+           $(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} + $? ))
@@ -1284,7 +1286,8 @@
        op="$1"
 
        failed=0
-       mta_path="$(${AWK} '/^sendmail[ \t]/{print$2}' ${DEST_DIR}/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
@@ -1578,11 +1581,11 @@
        [ -n "$1" ] || err 3 "USAGE: do_tcpdumpchroot  fix|check"
 
        failed=0;
-       if [ -r ${DEST_DIR}/var/chroot/tcpdump/etc/protocols ]; then
+       if [ -r "${DEST_DIR}/var/chroot/tcpdump/etc/protocols" ]; then
                if [ "$1" = "fix" ]; then
-                       rm ${DEST_DIR}/var/chroot/tcpdump/etc/protocols
+                       rm "${DEST_DIR}/var/chroot/tcpdump/etc/protocols"
                        failed=$(( ${failed} + $? ))
-                       rmdir  ${DEST_DIR}/var/chroot/tcpdump/etc
+                       rmdir "${DEST_DIR}/var/chroot/tcpdump/etc"
                        failed=$(( ${failed} + $? ))
                else
                        failed=1
@@ -1602,18 +1605,21 @@
        op="$1"
        failed=0
 
-       if grep '[^#]*unprivileged-user[ \t]*=.*_atf' ${DEST_DIR}/etc/atf/common.conf \
-           >/dev/null
+       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/" \
-                           ${DEST_DIR}/etc/atf/common.conf >${DEST_DIR}/etc/atf/common.conf.new
+                           "${DEST_DIR}/etc/atf/common.conf"\
+                           >"${DEST_DIR}/etc/atf/common.conf.new"
                        failed=$(( ${failed} + $? ))
-                       mv ${DEST_DIR}/etc/atf/common.conf.new ${DEST_DIR}/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 ${DEST_DIR}/etc/atf/common.conf" \
+                       msg "unprivileged-user=_atf in" \
+                           "${DEST_DIR}/etc/atf/common.conf" \
                            "should be _tests"
                        failed=1
                fi
@@ -1668,11 +1674,13 @@
        failed=0
        for manbase in /usr/share/man /usr/X11R6/man /usr/X11R7/man; do
                for sec in 1 2 3 4 5 6 7 8 9; do
-                       obsolete_catpages $1 ${DEST_DIR}${manbase} ${sec}
+                       obsolete_catpages "$1" "${DEST_DIR}${manbase}" "${sec}"
                        failed=$(( ${failed} + $? ))
                        if [ "$1" = "fix" ]; then
-                               rmdir ${DEST_DIR}${manbase}/cat${sec}/* 2>/dev/null
-                               rmdir ${DEST_DIR}${manbase}/cat${sec} 2>/dev/null
+                               rmdir "${DEST_DIR}${manbase}/cat${sec}"/* \
+                                       2>/dev/null
+                               rmdir "${DEST_DIR}${manbase}/cat${sec}" \
+                                       2>/dev/null
                        fi
                done
        done



Home | Main Index | Thread Index | Old Index