]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
ts-hosts-allocate-Executive: allow uncompressed log
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 11 Nov 2014 18:13:37 +0000 (18:13 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 17 Nov 2014 17:32:10 +0000 (17:32 +0000)
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
ts-hosts-allocate-Executive

index 0e9c19397a21f677c3c1610eb966d7f52586ffcc..73c1a45e4687f801eebe6ee14bd03a3f1a490a5c 100755 (executable)
@@ -29,12 +29,14 @@ tsreadconfig();
 
 open DEBUG, ">/dev/null" or die $!;
 
+our $compressdebug=1;
+
 while (@ARGV and $ARGV[0] =~ m/^-/) {
     $_= shift @ARGV;
     last if m/^--$/;
     while (m/^-./) {
-        if (0) {
-           # no options
+        if (s/^-U/-/) {
+           $compressdebug=0;
         } else {
             die "$_ ?";
         }
@@ -60,12 +62,16 @@ sub setup () {
 
     $taskid= findtask();
 
-    my $logbase = "hosts-allocate.debug.gz";
+    my $logbase = "hosts-allocate.debug".($compressdebug?".gz":"");
     my $logfh = open_unique_stashfile \$logbase;
-    my $logchild = open DEBUG, "|-";  defined $logchild or die $!;
-    if (!$logchild) {
-       open STDOUT, ">&", $logfh or die $!;
-       exec "gzip" or die $!;
+    if ($compressdebug) {
+       my $logchild = open DEBUG, "|-";  defined $logchild or die $!;
+       if (!$logchild) {
+           open STDOUT, ">&", $logfh or die $!;
+           exec "gzip" or die $!;
+       }
+    } else {
+       open DEBUG, ">&", $logfh or die $!;
     }
     DEBUG->autoflush(1);
     logm("host allocation debug log in $logbase");