Source-Changes-HG archive

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

[src/trunk]: src/etc In compare_dir(), when files don't match print:



details:   https://anonhg.NetBSD.org/src/rev/67657ce3da73
branches:  trunk
changeset: 536073:67657ce3da73
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Sep 06 08:58:48 2002 +0000

description:
In compare_dir(), when files don't match print:
        src != dest
instead of:
        dest != src
I think that's less confusing and more consistent.

In do_postfix(), if ${SRC_DIR}/gnu/dist/postfix/conf doesn't exist and
${DEST_DIR}/usr/share/examples/postfix does, use the latter for the
${DEST_DIR}/etc/postfix checks.  This means that postinstall can be
run in a temporary directory which has etc.tgz extracted into it
with -s `pwd`, (versus against a source tree), and the postfix upgrade
works correctly.

Remove some unnecessary goop.

diffstat:

 etc/postinstall |  28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diffs (73 lines):

diff -r 1bd526e46888 -r 67657ce3da73 etc/postinstall
--- a/etc/postinstall   Fri Sep 06 06:41:32 2002 +0000
+++ b/etc/postinstall   Fri Sep 06 08:58:48 2002 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.30 2002/09/06 06:41:32 lukem Exp $
+# $NetBSD: postinstall,v 1.31 2002/09/06 08:58:48 lukem Exp $
 #
 # Copyright (c) 2002 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -49,9 +49,6 @@
 #      - support quiet/verbose mode ?
 #      - check obsolete file lists -- need to remove non obsolete files from
 #        the sets first.
-#      - makedev and postinstall should work if run from an extracted
-#        etc.tgz (versus from the source tree) - postinstall does work in
-#        the former in -1-6 ?
 #
 
 #
@@ -185,7 +182,7 @@
                if [ ! -f "${fd}" ]; then
                        _error="${fd} does not exist"
                elif ! cmp -s ${fs} ${fd} ; then
-                       _error="${fd} != ${fs}"
+                       _error="${fs} != ${fd}"
                else
                        continue
                fi
@@ -302,7 +299,6 @@
 
        check_ids $1 groups "${DEST_DIR}/etc/group" \
            named ntpd sshd smmsp
-       return $?
 }
 
 #
@@ -315,7 +311,6 @@
 
        check_ids $1 users "${DEST_DIR}/etc/master.passwd" \
            named ntpd sshd smmsp
-       return $?
 }
 
 
@@ -536,11 +531,22 @@
        op=$1
        failed=0
 
-       compare_dir ${op} ${SRC_DIR}/gnu/dist/postfix/conf \
-               ${DEST_DIR}/etc/postfix 555 postfix-script
+       dirsrc=${SRC_DIR}/gnu/dist/postfix/conf
+       dirshare=${DEST_DIR}/usr/share/examples/postfix
+       if [ -d "${dirsrc}" ]; then
+               pfdir=$dirsrc
+       elif [ -d "${dirshare}" ]; then
+               pfdir=$dirshare
+               msg "Checking from ${pfdir} instead of ${dirsrc}"
+       else
+               msg "Can't find source directory"
+               return 1
+       fi
+
+       compare_dir ${op} ${pfdir} ${DEST_DIR}/etc/postfix 555 postfix-script
        failed=$(( ${failed} + $? ))
-       compare_dir ${op} ${SRC_DIR}/gnu/dist/postfix/conf \
-               ${DEST_DIR}/etc/postfix 444 post-install postfix-files
+       compare_dir ${op} ${pfdir} \
+           ${DEST_DIR}/etc/postfix 444 post-install postfix-files
        failed=$(( ${failed} + $? ))
 
        return ${failed}



Home | Main Index | Thread Index | Old Index