[mirrorbrain-commits] [opensuse-svn] r6726 - trunk/tools/download-redirector-v2/scanner

From: Novell Forge SVN <noreply_at_novell.com>
Date: Fri, 6 Mar 2009 05:30:28 -0700 (MST)
Author: poeml
Date: 2009-03-06 05:30:26 -0700 (Fri, 06 Mar 2009)
New Revision: 6726

Modified:
   trunk/tools/download-redirector-v2/scanner/scanner.pl
Log:
scanner:
- the -e (enable) option was another one that was not passed to spawned
  scanners, when scanning multiple mirrors. Fixed now.
- enabling after scan was not working anymore in cases where no old files had
  to be purged, because the $file_count variable was abused for that purpose


Modified: trunk/tools/download-redirector-v2/scanner/scanner.pl
===================================================================
--- trunk/tools/download-redirector-v2/scanner/scanner.pl	2009-03-06 11:25:51 UTC (rev 6725)
+++ trunk/tools/download-redirector-v2/scanner/scanner.pl	2009-03-06 12:30:26 UTC (rev 6726)
@@ -309,6 +309,7 @@
     push @cmd, '-I', $item;
   }
   push @cmd, '-f' if $force_scan;
+  push @cmd, '-e' if $enable_after_scan;
   push @cmd, '-x' if $extra_schedule_run;
   push @cmd, '-k' if $keep_dead_files;
   push @cmd, '-d', $start_dir if length $start_dir;
@@ -395,14 +396,14 @@
       $sql = "SELECT COUNT(mirr_del_byid($row->{id}, id)) FROM temp1";
       print "$sql\n" if $sqlverbose;
       $ary_ref = $dbh->selectall_arrayref($sql) or die $dbh->errstr();
-      $file_count = defined($ary_ref->[0]) ? $ary_ref->[0][0] : 0;
-      print localtime(time) . " $row->{identifier}: files to be purged: $file_count\n";
+      my $purge_file_count = defined($ary_ref->[0]) ? $ary_ref->[0][0] : 0;
+      print localtime(time) . " $row->{identifier}: files to be purged: $purge_file_count\n";
 
 
       $sql = "SELECT COUNT(*) FROM filearr WHERE $row->{id} = ANY(mirrors);";
       print "$sql\n" if $sqlverbose;
       my $ary_ref = $dbh->selectall_arrayref($sql) or die $dbh->errstr();
-      my $file_count = defined($ary_ref->[0]) ? $ary_ref->[0][0] : 0;
+      $file_count = defined($ary_ref->[0]) ? $ary_ref->[0][0] : 0;
       print localtime(time) . " $row->{identifier}: number of files: $file_count\n";
 
 

_______________________________________________
Opensuse-svn mailing list
Opensuse-svn_at_forge.novell.com
http://forge.novell.com/mailman/listinfo/opensuse-svn


_______________________________________________
mirrorbrain-commits mailing list

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on 2009-03-06Z12:30:54

This archive was generated by hypermail 2.2.0 : 2009-07-10Z19:18:12 GMT