~mdw
/
zoneconf
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
zoneconf.in: Isolate our local variables from the configuration file.
[zoneconf]
/
zoneconf.in
diff --git
a/zoneconf.in
b/zoneconf.in
index
d16e74a
..
22f170f
100755
(executable)
--- a/
zoneconf.in
+++ b/
zoneconf.in
@@
-198,6
+198,13
@@
proc run {what command args} {
}
}
}
}
+proc isolate {body} {
+ ## Evaluate BODY without changing the caller's variables. Return its
+ ## result.
+
+ eval $body
+}
+
###--------------------------------------------------------------------------
### Configuration spaces.
###
###--------------------------------------------------------------------------
### Configuration spaces.
###
@@
-1330,7
+1337,7
@@
defcmd outputs {} {
} {
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] }
}
@@
-1340,7
+1347,7
@@
defcmd update {} {
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
@@
-1395,7
+1402,7
@@
provided by the named USER."
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"]
@@
-1494,7
+1501,7
@@
defcmd sign {} {
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