]> xenbits.xensource.com Git - osstest.git/commitdiff
cr-ensure-disk-space: Honour -D
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 3 Jul 2015 16:39:08 +0000 (17:39 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 18 Sep 2015 11:37:30 +0000 (12:37 +0100)
Provide DEBUG and use db_prepare.  For now that is the only debugging
output.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
cr-ensure-disk-space

index 304f262d340effb4940993218e0e8fbed0432d65..ced977725135bd624f3cc05316305e483e83c52c 100755 (executable)
@@ -27,11 +27,15 @@ use Fcntl qw(:flock);
 
 our $dryrun= 0;
 
+open DEBUG, ">/dev/null" or die $!;
+
 while (@ARGV && $ARGV[0] =~ m/^\-/) {
     $_= shift @ARGV;
     last if $_ eq '--';
     if (m/^-n$/) {
         $dryrun= 1;
+    } elsif (m/^-D$/) {
+        open DEBUG, ">&2" or die $!;
     } else {
        die "$_ ?";
     }
@@ -50,7 +54,7 @@ flock LOCK, LOCK_EX or die $!;
 
 $|=1;
 
-my $chkq= $dbh_tests->prepare("SELECT * FROM flights WHERE flight=?");
+my $chkq= db_prepare("SELECT * FROM flights WHERE flight=?");
 our @flights;
 
 for (;;) {