]> jspc29.x-matter.uni-frankfurt.de Git - mvdsensorcontrol.git/commitdiff
improved debug output of run.pl (called by testgui)
authorMichael Wiebusch <m.wiebusch@gsi.de>
Tue, 10 Feb 2015 18:43:30 +0000 (19:43 +0100)
committerMichael Wiebusch <m.wiebusch@gsi.de>
Tue, 10 Feb 2015 18:43:30 +0000 (19:43 +0100)
tools/run.pl

index 8180c246c4a96410b149b530e3ad1b3832ca6822..ebae89e98d7771694a3a2b995d18a8082f0805ef 100755 (executable)
@@ -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 "<pre>";
-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/<br>/g;
@@ -110,3 +112,9 @@ print "</pre>";
 
 print end_html;
 
+sub print_exec {
+  my $arg = join("",@_);
+  print ">>> exec >>> ".$arg."\n";
+  system($arg);
+  print "<<<<<<<<<<<<\n\n";
+}