Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
5771f06b
Commit
5771f06b
authored
Jan 22, 2010
by
Robert Ricci
Browse files
Add sitevars marked with the new include_ns column to the NS
'preamble'.
parent
11c8cc52
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/ns2ir/parse-ns.in
View file @
5771f06b
...
@@ -566,6 +566,28 @@ sub GenDefsFile($)
...
@@ -566,6 +566,28 @@ sub GenDefsFile($)
}
}
print
TCL
"
\n
";
print
TCL
"
\n
";
print
TCL
"
# Site variables
\n
";
$query_result
=
DBQueryFatal
("
select name,value,defaultvalue
"
.
"
from sitevariables where ns_include=TRUE
");
while
(
my
(
$name
,
$value
,
$defaultvalue
)
=
$query_result
->
fetchrow_array
())
{
# Use the default value if unset, or skip altogether if the default
# is just the empty string.
if
(
!
defined
(
$value
))
{
if
(
$defaultvalue
eq
"")
{
next
;
}
else
{
$value
=
$defaultvalue
;
}
}
# Escape special characters in the value (just braces)
$value
=~
s/([{}])/\\$1/g
;
# Note: braces in tcl act like single quotes in other scripting
# languages (eg. no interpolation occurs)
print
TCL
"
set sitevariables(
$name
) {
$value
}
\n
";
}
print
TCL
"
\n
";
if
(
defined
(
$pid
))
{
if
(
defined
(
$pid
))
{
print
TCL
"
# OSIDs
\n
";
print
TCL
"
# OSIDs
\n
";
$query_result
=
$query_result
=
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment