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

Annotation of openbsd/OpenBSDTorrents/NewTorrents.pl, Revision 1.1

1.1     ! andrew      1: #!/usr/bin/perl -T
        !             2: #$Id: MakeTorrents.pl,v 1.7 2005/03/24 00:21:43 andrew Exp $
        !             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) {
        !            23:                        # This actually needs to be a sub that forks off
        !            24:                        # the generation of this, and the running of the update script.
        !            25:                        print "MakeTorrent.pl $BaseName/$dir\n";
        !            26:                }
        !            27:                $last_dir = $dir;
        !            28:        } else {
        !            29:                #print $_;
        !            30:        }
        !            31: }

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