Annotation of openbsd/OpenBSDTorrents/NewTorrents.pl, Revision 1.2
1.1 andrew 1: #!/usr/bin/perl -T
1.2 ! andrew 2: #$Id: NewTorrents.pl,v 1.1 2005/03/24 05:28:08 andrew Exp andrew $
1.1 andrew 3: use strict;
4: use warnings;
5: use diagnostics;
6:
7: use lib 'lib';
8: use OpenBSDTorrents;
9:
10: %ENV = ();
11:
12: use YAML;
13:
14: my $last_dir = '';
15: while (<>) {
16: chomp;
17: if (my ($year, $mon, $mday, $time, $pid, $oper, $file, $size) =
18: m#^(\d{4})/(\d{2})/(\d{2}) (\d{2}:\d{2}:\d{2}) \[(\d+)\] (\S+) (.+) (\d+)$# ) {
19: #print "($year, $mon, $mday, $time, $pid, $oper, $file, $size)\n";
20: my ($dir, $file) = $file =~ m#^(.*)/([^/]+)#;
21: #print "$dir - $file\n";
22: if ($last_dir && $last_dir ne $dir) {
1.2 ! andrew 23: StartTorrent($last_dir);
1.1 andrew 24: }
25: $last_dir = $dir;
26: } else {
27: #print $_;
28: }
1.2 ! andrew 29: }
! 30: StartTorrent($last_dir);
! 31:
! 32: sub StartTorrent
! 33: {
! 34: my $dir = shift;
! 35:
! 36: # This actually needs to be a sub that forks off
! 37: # the generation of this, and the running of the update script.
! 38: print "MakeTorrents.pl $BaseName/$dir\n";
1.1 andrew 39: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>