/[perl]/mirror_cpan.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /mirror_cpan.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dpavlin, Sat Feb 1 00:40:22 2003 UTC revision 1.2 by dpavlin, Sat Feb 1 00:51:51 2003 UTC
# Line 21  my $REMOTE = "http://www.cpan.org/"; Line 21  my $REMOTE = "http://www.cpan.org/";
21  # my $REMOTE = "file://Users/merlyn/MIRROR/CPAN/";  # my $REMOTE = "file://Users/merlyn/MIRROR/CPAN/";
22    
23  ## warning: unknown files below this dir are deleted!  ## warning: unknown files below this dir are deleted!
24  my $LOCAL = "/mirrors/cpan/CPAN/";  #my $LOCAL = "/mirrors/cpan/CPAN/";
25    my $LOCAL = "/rest/cpan/CPAN/";
26    
27  my $TRACE = 0;  my $TRACE = 0;
28    
# Line 122  BEGIN { Line 123  BEGIN {
123        print "$File::Find::name ... removed\n" if $TRACE;        print "$File::Find::name ... removed\n" if $TRACE;
124        unlink $_ or warn "Cannot remove $File::Find::name: $!";        unlink $_ or warn "Cannot remove $File::Find::name: $!";
125        my $path = $File::Find::name;        my $path = $File::Find::name;
126        if ($path =~ s/\.tar\.gz/.readme/g && -f $path) {        if ($path =~ s/(\.tar\.gz|\.tgz)/.readme/g && -f $path) {
127          # only if we erase archive also!          # only if we erase archive also!
128          unlink $path or warn "Cannot remove $path: $!";          unlink $path or warn "Cannot remove $path: $!";
129        }        }
# Line 132  BEGIN { Line 133  BEGIN {
133    sub check_readme {    sub check_readme {
134    
135      my $path = shift;      my $path = shift;
   
136      # fixup some things      # fixup some things
137      my $readme_path = $path;      my $readme_path = $path;
138      $readme_path =~ s/\.tar\.gz/.readme/g || return;    # just .tar.gz is supported!      $readme_path =~ s/\.(tar\.gz|\.tgz)/.readme/g || return;    # just .tar.gz is supported!
139    
140      my $at = Archive::Tar->new($path) or die "Archive::Tar failed on $path\n";      my $at = Archive::Tar->new($path) or die "Archive::Tar failed on $path\n";
141    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26