Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/postinstall Check for and delete ${DEST_DIR}/@RUNDI...



details:   https://anonhg.NetBSD.org/src/rev/5aa0f09fb1cf
branches:  trunk
changeset: 331491:5aa0f09fb1cf
user:      apb <apb%NetBSD.org@localhost>
date:      Tue Aug 12 08:28:04 2014 +0000

description:
Check for and delete ${DEST_DIR}/@RUNDIR@, not /@RUNDIR@.
Also remove an unnecessary eval in do_dhcpcdrundir and
fix a typo in the description.

diffstat:

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

diffs (39 lines):

diff -r 5d2e6377ed25 -r 5aa0f09fb1cf usr.sbin/postinstall/postinstall
--- a/usr.sbin/postinstall/postinstall  Tue Aug 12 08:06:46 2014 +0000
+++ b/usr.sbin/postinstall/postinstall  Tue Aug 12 08:28:04 2014 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.176 2014/08/11 12:49:01 roy Exp $
+# $NetBSD: postinstall,v 1.177 2014/08/12 08:28:04 apb Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -880,22 +880,22 @@
 #
 #      dhcpcdrundir
 #
-additem dhcpcdrundir "accientaly created /@RUNDIR@ does not exist"
+additem dhcpcdrundir "accidentaly created /@RUNDIR@ does not exist"
 do_dhcpcdrundir()
 {
        [ -n "$1" ] || err 3 "USAGE: do_dhcpcdrundir fix|check"
        op="$1"
        failed=0
 
-       if [ -d /@RUNDIR@ ]; then
+       if [ -d "${DEST_DIR}/@RUNDIR@" ]; then
                if [ "${op}" = "check" ]; then
                        msg "Remove eroneously created /@RUNDIR@"
                        failed=1
-               elif ! eval "rm -r /@RUNDIR@"; then
-                       msg "Failed to remove /@RUNDIR@"
+               elif ! rm -r "${DEST_DIR}/@RUNDIR@"; then
+                       msg "Failed to remove ${DEST_DIR}/@RUNDIR@"
                        failed=1
                else
-                       msg "Removed eroneously created /@RUNDIR@"
+                       msg "Removed eroneously created ${DEST_DIR}/@RUNDIR@"
                fi
        fi
        return ${failed}



Home | Main Index | Thread Index | Old Index