From: Michael Wiebusch Date: Tue, 10 Feb 2015 18:43:30 +0000 (+0100) Subject: improved debug output of run.pl (called by testgui) X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=d40116e2449a7323be539f1f4239dff2e81e9c60;p=mvdsensorcontrol.git improved debug output of run.pl (called by testgui) --- diff --git a/tools/run.pl b/tools/run.pl index 8180c24..ebae89e 100755 --- a/tools/run.pl +++ b/tools/run.pl @@ -18,6 +18,8 @@ use FindBin; use lib "$FindBin::Bin/.."; use Environment; +use subs qw(print_exec); + my $here = getcwd(); my $q = CGI->new; @@ -71,13 +73,13 @@ print start_html( unless(-e $dumpPath) { print "creating data dump directory: $dumpPath\n"; - system("mkdir -p $dumpPath"); + print_exec "mkdir -p $dumpPath"; die "Unable to create $dumpPath\n" unless(-e $dumpPath); } unless(-e $picPath) { print "creating plot directory: $picPath\n"; - system("mkdir -p $picPath"); + print_exec "mkdir -p $picPath"; die "Unable to create $picPath\n" unless(-e $picPath); } @@ -85,23 +87,23 @@ unless(-e $picPath) { my $dummy; print "
";
-print qx|date|;
-print qx"./init_setup.pl $setupFile";
+print_exec "date";
+print_exec "./init_setup.pl $setupFile";
+
 
 unless($q->param('startupOnly') eq 'true'){
-  print qx|date|;
-  print qx"rm $dumpPath/te1*.hld 2>&1";
-  print "./preview/exec_evtbuild_t.pl -t $runtime -p $dumpPath -s $systemName -d $ports 2>&1";
-  print qx"./preview/exec_evtbuild_t.pl -t $runtime -p $dumpPath -s $systemName -d $ports 2>&1";
-  print qx|date|;
-  print qx"rm $dumpPath/temp.hld 2>&1";
-  print qx"mv $dumpPath/te1* $dumpPath/temp.hld 2>&1";
-  print qx|ls -lh  $dumpPath/temp.hld|;
-  print qx|date|;
-  print qx"rm $picPath/$systemName*.png 2>&1"; # delete old pictures
-#  print qx"./preview/unpack_hld.pl -r -f $dumpPath/temp.hld -p $picPath -s $systemName 2>&1";
-  print qx"./unpacker/run.sh $dumpPath/temp.hld $picPath $systemName 2>&1";
-  print qx|date|;
+  print_exec "date";
+  print_exec "rm $dumpPath/te1*.hld 2>&1";
+  print_exec "./preview/exec_evtbuild_t.pl -t $runtime -p $dumpPath -s $systemName -d $ports 2>&1";
+  print_exec "date";
+  print_exec "rm $dumpPath/temp.hld 2>&1";
+  print_exec "mv $dumpPath/te1* $dumpPath/temp.hld 2>&1";
+  print_exec "ls -lh  $dumpPath/temp.hld";
+  print_exec "date";
+  print_exec "rm $picPath/$systemName*.png 2>&1"; # delete old pictures
+#  print_exec "./preview/unpack_hld.pl -r -f $dumpPath/temp.hld -p $picPath -s $systemName 2>&1";
+  print_exec "./unpacker/run.sh $dumpPath/temp.hld $picPath $systemName 2>&1";
+  print_exec "date";
 }
 #my $escapedDummy = escapeHTML($dummy);
 #$escapedDummy =~ s/\n/
/g; @@ -110,3 +112,9 @@ print "
"; print end_html; +sub print_exec { + my $arg = join("",@_); + print ">>> exec >>> ".$arg."\n"; + system($arg); + print "<<<<<<<<<<<<\n\n"; +}