[BACK]Return to NewTorrents.pl CVS log [TXT][DIR] Up to [local] / openbsd / OpenBSDTorrents

Diff for /openbsd/OpenBSDTorrents/NewTorrents.pl between version 1.9 and 1.10

version 1.9, 2006/05/15 19:47:04 version 1.10, 2006/07/24 19:03:53
Line 1 
Line 1 
 #!/usr/bin/perl -T  #!/usr/bin/perl -T
 #$RedRiver: NewTorrents.pl,v 1.8 2005/05/05 01:07:16 andrew Exp $  #$RedRiver: NewTorrents.pl,v 1.9 2006/05/15 18:47:04 andrew Exp $
 use strict;  use strict;
 use warnings;  use warnings;
 use diagnostics;  use diagnostics;
Line 17 
Line 17 
   
 use YAML;  use YAML;
   
 # *** This requires --log-format="%t [%p] %o %f %l" on the rsync command  
   
 my $last_dir = '';  my $last_dir = '';
 while (<>) {  while (<>) {
         chomp;          chomp;
         if (my ($year,  $mon,  $mday,   $time,               $pid,   $oper, $file, $size) =          print $_, "\n";
             m#^(\d{4})/(\d{2})/(\d{2}) (\d{2}:\d{2}:\d{2}) \[(\d+)\] (\S+) (.+) (\d+)$# ) {          if (my ($message, $file) = m#(.*)\s+\`([^']+)'#) {
                 #print "($year, $mon, $mday, $time, $pid, $oper, $file, $size)\n";                  next if $message eq 'Making directory';
                 my ($dir, $file) = $file =~ m#^(.*)/([^/]+)#;  
                 #print "$dir - $file\n";                  my $dir = '';
                   if ($file =~ m#^(.*)/([^/]+)#) {
                           ($dir, $file) = ($1, $2);
                   }
                   #print "$message - $dir - $file\n";
                 if ($last_dir && $last_dir ne $dir) {                  if ($last_dir && $last_dir ne $dir) {
                         StartTorrent($last_dir);                          StartTorrent($last_dir);
                 }                  }
                 $last_dir = $dir;                  $last_dir = $dir;
         } else {  
                 #print $_;  
         }          }
 }  }
   
Line 86 
Line 87 
                 }                  }
   
         }          }
   
         chdir $OBT->{DIR_HOME} or die "Can't chdir to $OBT->{DIR_HOME}: $!";  
   
         if (@now_update) {          if (@now_update) {
                 print "Making torrents for ", join(" ", @now_update), "\n";                  print "Making torrents for ", join(" ", @now_update), "\n";

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>