Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/postinstall Invert the chroot/tcpdump/etc test and ...



details:   https://anonhg.NetBSD.org/src/rev/79a03518ad8a
branches:  trunk
changeset: 764354:79a03518ad8a
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Apr 17 13:16:59 2011 +0000

description:
Invert the chroot/tcpdump/etc test and make it remove the (not needed
anymore) directory.

diffstat:

 usr.sbin/postinstall/postinstall |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (34 lines):

diff -r 9e870791d618 -r 79a03518ad8a usr.sbin/postinstall/postinstall
--- a/usr.sbin/postinstall/postinstall  Sun Apr 17 13:09:30 2011 +0000
+++ b/usr.sbin/postinstall/postinstall  Sun Apr 17 13:16:59 2011 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.116 2011/04/11 20:29:50 martin Exp $
+# $NetBSD: postinstall,v 1.117 2011/04/17 13:16:59 martin Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1467,17 +1467,17 @@
 #
 #      tcpdumpchroot
 #
-additem tcpdumpchroot "make sure /var/chroot/tcpdump/etc is populated"
+additem tcpdumpchroot "remove /var/chroot/tcpdump/etc/protocols"
 do_tcpdumpchroot()
 {
        [ -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
-                       mkdir -p ${DEST_DIR}/var/chroot/tcpdump/etc
-                       cp ${SRC_DIR}/etc/protocols \
-                               ${DEST_DIR}/var/chroot/tcpdump/etc
+                       rm ${DEST_DIR}/var/chroot/tcpdump/etc/protocols
+                       failed=$(( ${failed} + $? ))
+                       rmdir  ${DEST_DIR}/var/chroot/tcpdump/etc
                        failed=$(( ${failed} + $? ))
                else
                        failed=1



Home | Main Index | Thread Index | Old Index