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

When exporting a single run, be careful not to remove other runs.

parent 7d7c0999
......@@ -156,10 +156,17 @@ my $checkout = "$projroot/$pid/export/$guid/$version/$exptidx";
# Cleanup existing goo.
if (-e $checkout) {
system("/bin/rm -rf $checkout");
my $dirtoremove = $checkout;
$dirtoremove .= "/run${runidx}"
if (defined($runidx));
system("/bin/rm -rf $dirtoremove");
if (! -e $checkout) {
system("mkdir -p $checkout") == 0
or fatal(-1, "Could not mkdir $checkout");
system("mkdir -p $checkout") == 0
or fatal(-1, "Could not mkdir $checkout");
# Since that worked, lets create the XML representation of it and stash
......@@ -239,6 +246,9 @@ if ($debug) {
# Stash this into the checkout directory we created above.
if (-e "$checkout/export.xml");
open(DUMP, ">$checkout/export.xml")
or fatal(-1, "Could not open $checkout/export.xml for writing");
print DUMP "$xml\n";
Supports Markdown
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