Source-Changes-HG archive

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

[src/trunk]: src/etc Fix some errors in the way scripts with "KEYWORD: intera...



details:   https://anonhg.NetBSD.org/src/rev/211ed366e4bc
branches:  trunk
changeset: 747440:211ed366e4bc
user:      apb <apb%NetBSD.org@localhost>
date:      Mon Sep 14 22:30:30 2009 +0000

description:
Fix some errors in the way scripts with "KEYWORD: interactive"
are handled.  There was an inverted test, and "set $_args"
had the wrong scope (in several nearly-identical blocks of code).

diffstat:

 etc/rc.subr |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 4c5c49bb45e7 -r 211ed366e4bc etc/rc.subr
--- a/etc/rc.subr       Mon Sep 14 21:10:44 2009 +0000
+++ b/etc/rc.subr       Mon Sep 14 22:30:30 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.79 2009/09/14 12:05:12 apb Exp $
+# $NetBSD: rc.subr,v 1.80 2009/09/14 22:30:30 apb Exp $
 #
 # Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -802,7 +802,7 @@
        eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd
 
        _must_redirect=false
-       if ! [ -n "${_rc_postprocessor_fd}" ] \
+       if [ -n "${_rc_postprocessor_fd}" ] \
            && _has_rcorder_keyword interactive $_file
        then
                _must_redirect=true
@@ -813,7 +813,8 @@
                if $_must_redirect; then
                        print_rc_metadata \
                            "note:Output from ${_file} is not logged"
-                       set $_arg ; no_rc_postprocess . $_file
+                       no_rc_postprocess eval \
+                           'set $_arg ; . $_file'
                else
                        set $_arg ; . $_file
                fi
@@ -826,9 +827,11 @@
                        print_rc_metadata \
                            "note:Output from ${_file} is not logged"
                        if [ -n "$rc_fast_and_loose" ]; then
-                               set $_arg ; no_rc_postprocess . $_file
+                               no_rc_postprocess eval \
+                                   'set $_arg ; . $_file'
                        else
-                               ( set $_arg ; no_rc_postprocess . $_file )
+                               no_rc_postprocess eval \
+                                   '( set $_arg ; . $_file )'
                        fi
                elif [ -x $_file ]; then
                        if [ -n "$rc_fast_and_loose" ]; then



Home | Main Index | Thread Index | Old Index