Commit 10673342 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Hack for dealing with user output from the parser (puts). Since I spit

the XML to stdout, user calls to puts confuse the converter, and get
lost so the user never sees them (before, they would end up in the
start/preload log). The converter now eats up lines till it sees a
valid XML header string, printing those lines to stdout so they end up
in the log like before.

Need to deal with this in a better manner at some point. I did not
want to write the XML to temporary file. Not sure why, but I thought
that was the right approach, to keep the user from getting his grubby
little hands on it. I'm thinking now thats silly, and I'll eventually
fix things up (since it requires more TCL hacking, and I don't have
the energy for that).
parent 6a029369
......@@ -19,7 +19,7 @@ sub usage()
exit(-1);
}
my $optlist = "x:vd";
my $optlist = "x:nd";
my $fromxml = 0;
my $impotent = 0;
my $debug = 0;
......@@ -155,13 +155,21 @@ sub readXML($$$) {
}
#
# Check the header.
# We want to see a proper XML header. However, if this is coming out
# of the parser, there could be some user output ahead of it. At some
# point we need to fix how we deal with user output, but for now lets
# just eat up the lines till we see the header, printing them to stdout
# so that it ends up in the log.
#
$line = <STDIN>;
chomp($line);
if ($line ne $XMLHEADER) {
fatal("Improper XML header line: $line");
while (<STDIN>) {
chomp($_);
last
if ($_ eq $XMLHEADER);
print STDOUT "$_\n";
}
fatal("Improper XML header line")
if (! defined($_));
#
# The next line should be the virtual_experiment line, with the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment