I had a signature failure after changing the configuration file caused
by variables set in the config file interfering with those in the
command procedure. There are good reasons why `confspc-eval' uses
`uplevel'; but this situation is bad, so it wants fixing properly.
Introduce a new procedure `isolate' which exists largely so its
variables can be clobbered with impunity.
+proc isolate {body} {
+ ## Evaluate BODY without changing the caller's variables. Return its
+ ## result.
+
+ eval $body
+}
+
###--------------------------------------------------------------------------
### Configuration spaces.
###
###--------------------------------------------------------------------------
### Configuration spaces.
###
} {
global ZONECFG CONFFILE
} {
global ZONECFG CONFFILE
- confspc-eval toplevel [list source $CONFFILE]
+ isolate [list confspc-eval toplevel [list source $CONFFILE]]
foreach view $ZONECFG(all-views) { puts [output-file-name $view] }
}
foreach view $ZONECFG(all-views) { puts [output-file-name $view] }
}
global ZONECFG ZONES CONFFILE
## Read the configuration.
global ZONECFG ZONES CONFFILE
## Read the configuration.
- confspc-eval toplevel [list source $CONFFILE]
+ isolate [list confspc-eval toplevel [list source $CONFFILE]]
## Safely update the files.
set win false
## Safely update the files.
set win false
global QUIS ZONECFG ZONES CONFFILE errorInfo errorCode
## Read the configuration.
global QUIS ZONECFG ZONES CONFFILE errorInfo errorCode
## Read the configuration.
- confspc-eval toplevel [list source $CONFFILE]
+ isolate [list confspc-eval toplevel [list source $CONFFILE]]
## Make sure there's a temporary directory.
file mkdir [file join $ZONECFG(home-dir) "tmp"]
## Make sure there's a temporary directory.
file mkdir [file join $ZONECFG(home-dir) "tmp"]
set rc 0
## Read the configuration.
set rc 0
## Read the configuration.
- confspc-eval toplevel [list source $CONFFILE]
+ isolate [list confspc-eval toplevel [list source $CONFFILE]]
## Grind through all of the zones.
array unset seen
## Grind through all of the zones.
array unset seen