Author: ranger
Date: Wed Jun 24 23:55:21 2009
New Revision: 1581

URL: 
<http://svn.finkproject.org/websvn/listing.php?sc=1&rev=1581&repname=user%3a+ranger>
Log:
in the 10.4 tree, check 10.4/10.5/10.6 since some packages are masked

Modified:
    trunk/experimental/scripts/generate-distfiles-and-finkinfo-mirror.pl

Modified: trunk/experimental/scripts/generate-distfiles-and-finkinfo-mirror.pl
URL: 
<http://svn.finkproject.org/websvn/diff.php?path=/trunk/experimental/scripts/generate-distfiles-and-finkinfo-mirror.pl&rev=1581&repname=user%3a+ranger>
==============================================================================
--- trunk/experimental/scripts/generate-distfiles-and-finkinfo-mirror.pl 
(original)
+++ trunk/experimental/scripts/generate-distfiles-and-finkinfo-mirror.pl Wed 
Jun 24 23:55:21 2009
@@ -131,10 +131,8 @@
 opendir(DIR, $CHECKOUTDIR . '/dists') or die "unable to read from 
$CHECKOUTDIR/dists: $!";
 for my $dir (readdir(DIR))
 {
-#      if ($dir =~ /^10/)
        if ($dir eq '10.3' or $dir eq '10.4')
        {
-#              next if ($dir =~ /^10.2/);
                print LOG "searching $dir\n";
                finddepth( { wanted => \&find_fetch_infofile, follow => 1 }, 
$CHECKOUTDIR . '/dists/' . $dir);
        }
@@ -189,137 +187,141 @@
                @arches = ('powerpc', 'i386');
        }
 
-       for my $arch (@arches)
-       {
-
-               $Fink::Config::config = Fink::Config->new_from_properties({
-                       basepath       => $WORKDIR,
-                       distribution   => $dist,
-#                      downloadmethod => 'axel',
-                       downloadmethod => 'lftpget',
-#                      downloadmethod => 'curl',
-                       architecture   => $arch,
-                       downloadtimeout => 3600, # try up to 1 hour to download 
something
-               });
-               $Fink::Config::libpath = $FINKROOT;
-
-               my ($tree) = $File::Find::name =~ m#/dists/[^/]+/([^/]+)/#;
-               print LOG "- fetching files for $shortname ($dist/$tree)\n";
-               for my $package ( Fink::PkgVersion->pkgversions_from_info_file( 
$File::Find::name ) )
+       if ($dist =~ /^10.4$/)
+       {
+               for my $dist ('10.4', '10.5', '10.6')
                {
-                       next if ( $package->get_license() =~ /Restrictive$/ );
-                       for my $suffix ($package->get_source_suffices)
+                       for my $arch (@arches)
                        {
-                               my $tarball = $package->get_tarball($suffix);
-                               print LOG "  - $tarball... ";
-                               my $checksums = {};
-                               $checksums->{'MD5'} = $package->param('Source' 
. $suffix . '-MD5');
-                               my($checksum_type, $checksum) = 
Fink::Checksum->parse_checksum($package->get_checksum($suffix));
-                               $checksums->{$checksum_type} = $checksum;
-       
-                               if (not -l $DOWNLOADDIR . '/' . $tarball)
+               
+                               $Fink::Config::config = 
Fink::Config->new_from_properties({
+                                       basepath       => $WORKDIR,
+                                       distribution   => $dist,
+                                       downloadmethod => 'lftpget',
+                                       architecture   => $arch,
+                                       downloadtimeout => 3600, # try up to 1 
hour to download something
+                               });
+                               $Fink::Config::libpath = $FINKROOT;
+               
+                               my ($tree) = $File::Find::name =~ 
m#/dists/[^/]+/([^/]+)/#;
+                               print LOG "- fetching files for $shortname 
($dist/$tree)\n";
+                               for my $package ( 
Fink::PkgVersion->pkgversions_from_info_file( $File::Find::name ) )
                                {
-                                       my $file_checksums = 
Fink::Checksum->get_all_checksums($DOWNLOADDIR . '/' . $tarball);
-                                       my $master_checksum_type = 'MD5';
-                                       if (exists 
$file_checksums->{$master_checksum_type})
+                                       next if ( $package->get_license() =~ 
/Restrictive$/ );
+                                       for my $suffix 
($package->get_source_suffices)
                                        {
-                                               mkpath($DOWNLOADDIR . '/md5/' . 
$file_checksums->{$master_checksum_type});
-                                               move($DOWNLOADDIR . '/' . 
$tarball, $DOWNLOADDIR . '/md5/' . $file_checksums->{$master_checksum_type} . 
'/' . $tarball);
-                                               for my $checksum_type (keys 
%$file_checksums)
+                                               my $tarball = 
$package->get_tarball($suffix);
+                                               print LOG "  - $tarball... ";
+                                               my $checksums = {};
+                                               $checksums->{'MD5'} = 
$package->param('Source' . $suffix . '-MD5');
+                                               my($checksum_type, $checksum) = 
Fink::Checksum->parse_checksum($package->get_checksum($suffix));
+                                               $checksums->{$checksum_type} = 
$checksum;
+                       
+                                               if (not -l $DOWNLOADDIR . '/' . 
$tarball)
                                                {
-                                                       next if ($key eq 
$master_checksum_type);
-                                                       mkpath($DOWNLOADDIR . 
'/' . lc($checksum_type) . '/' . lc($file_checksums->{$checksum_type}));
-                                                       symlink(
-                                                               '../../' . 
lc($master_checksum_type) . '/' . lc($file_checksums->{$master_checksum_type}) 
. '/' . $tarball,
-                                                               $DOWNLOADDIR . 
'/' . lc($checksum_type) . '/' . lc($file_checksums->{$checksum_type}) . '/' . 
$tarball
-                                                       );
-                                                       unlink( $DOWNLOADDIR . 
'/' . $tarball );
-                                                       symlink(
-                                                               
lc($master_checksum_type) . '/' . lc($file_checksums->{$master_checksum_type}) 
. '/' . $tarball,
-                                                               $DOWNLOADDIR . 
'/' . $tarball,
-                                                       );
-       
+                                                       my $file_checksums = 
Fink::Checksum->get_all_checksums($DOWNLOADDIR . '/' . $tarball);
+                                                       my 
$master_checksum_type = 'MD5';
+                                                       if (exists 
$file_checksums->{$master_checksum_type})
+                                                       {
+                                                               
mkpath($DOWNLOADDIR . '/md5/' . $file_checksums->{$master_checksum_type});
+                                                               
move($DOWNLOADDIR . '/' . $tarball, $DOWNLOADDIR . '/md5/' . 
$file_checksums->{$master_checksum_type} . '/' . $tarball);
+                                                               for my 
$checksum_type (keys %$file_checksums)
+                                                               {
+                                                                       next if 
($key eq $master_checksum_type);
+                                                                       
mkpath($DOWNLOADDIR . '/' . lc($checksum_type) . '/' . 
lc($file_checksums->{$checksum_type}));
+                                                                       symlink(
+                                                                               
'../../' . lc($master_checksum_type) . '/' . 
lc($file_checksums->{$master_checksum_type}) . '/' . $tarball,
+                                                                               
$DOWNLOADDIR . '/' . lc($checksum_type) . '/' . 
lc($file_checksums->{$checksum_type}) . '/' . $tarball
+                                                                       );
+                                                                       unlink( 
$DOWNLOADDIR . '/' . $tarball );
+                                                                       symlink(
+                                                                               
lc($master_checksum_type) . '/' . lc($file_checksums->{$master_checksum_type}) 
. '/' . $tarball,
+                                                                               
$DOWNLOADDIR . '/' . $tarball,
+                                                                       );
+                       
+                                                               }
+                                                       }
+                                               }
+                       
+                                               my $do_download = (not -e 
$DOWNLOADDIR . '/' . $tarball);
+                                               for $checksum_type (keys 
%$checksums)
+                                               {
+                                                       next if (not defined 
$checksum_type or $checksum_type =~ /^\s*$/);
+                                                       my $check_file = 
$DOWNLOADDIR . '/' . lc($checksum_type) . '/' . 
lc($checksums->{$checksum_type}) . '/' . $tarball;
+                                                       if (not -f $check_file)
+                                                       {
+                                                               print LOG 
"$check_file does not exist, downloading\n";
+                                                               $do_download = 
1;
+                                                       }
+                                                       elsif 
($VALIDATE_EXISTING_FILES)
+                                                       {
+                                                               if (not 
Fink::Checksum->validate($check_file, $checksums->{$checksum_type}, 
$checksum_type))
+                                                               {
+                                                                       print 
LOG "checksum on $check_file does not match, downloading\n";
+                                                                       
$do_download = 1;
+                                                               }
+                                                       }
+                                               }
+                                               if ($do_download)
+                                               {
+                                                       print LOG 
"downloading\n";
+                                                       my 
$master_checksum_type = 'MD5';
+                                                       if (not exists 
$checksums->{'MD5'})
+                                                       {
+                                                               my @types = 
sort keys %$checksums;
+                                                               
$master_checksum_type = shift(@types);
+                                                       }
+                                                       my $download_path = 
$DOWNLOADDIR . '/' . lc($master_checksum_type) . '/' . 
$checksums->{$master_checksum_type};
+                                                       my $url = 
$package->get_source($suffix);
+                                                       my $returnval = 
&fetch_url_to_file({
+                                                               url             
   => $url,
+                                                               filename        
   => $tarball,
+                                                               custom_mirror   
   => $package->get_custom_mirror($suffix),
+                                                               
skip_master_mirror => 1,
+                                                               
download_directory => $download_path,
+                                                               checksum        
   => $checksums->{$master_checksum_type},
+                                                               checksum_type   
   => $master_checksum_type,
+                                                               try_all_mirrors 
   => 1,
+                                                       });
+                                                       if ($returnval != 0)
+                                                       {
+                                                               
unlink($download_path . '/' . $tarball);
+                                                               print LOG 
"unable to download $url to $download_path\n";
+                                                               
$all_downloads_passed = 0;
+                                                               next;
+                                                       }
+                       
+                                                       my $file_checksums = 
Fink::Checksum->get_all_checksums($download_path . '/' . $tarball);
+                                                       for my $checksum_type 
(keys %$file_checksums)
+                                                       {
+                                                               if 
($checksum_type eq $master_checksum_type)
+                                                               {
+                                                                       if 
($file_checksums->{$checksum_type} ne $checksums->{$checksum_type})
+                                                                       {
+                                                                               
print LOG "downloaded file has a different checksum than expected 
($file_checksums->{$checksum_type} ne $checksums->{$checksum_type})\n";
+                                                                       }
+                                                               }
+                                                               else
+                                                               {
+                                                                       
mkpath($DOWNLOADDIR . '/' . lc($checksum_type) . '/' . 
lc($file_checksums->{$checksum_type}));
+                                                                       symlink(
+                                                                               
'../../' . lc($master_checksum_type) . '/' . 
lc($checksums->{$master_checksum_type}) . '/' . $tarball,
+                                                                               
$DOWNLOADDIR . '/' . lc($checksum_type) . '/' . 
lc($file_checksums->{$checksum_type}) . '/' . $tarball
+                                                                       );
+                                                                       unlink( 
$DOWNLOADDIR . '/' . $tarball );
+                                                                       symlink(
+                                                                               
lc($master_checksum_type) . '/' . lc($checksums->{$master_checksum_type}) . '/' 
. $tarball,
+                                                                               
$DOWNLOADDIR . '/' . $tarball,
+                                                                       );
+                                                               }
+                                                       }
+                                               }
+                                               else
+                                               {
+                                                       print LOG "exists\n";
                                                }
                                        }
                                }
-       
-                               my $do_download = (not -e $DOWNLOADDIR . '/' . 
$tarball);
-                               for $checksum_type (keys %$checksums)
-                               {
-                                       next if (not defined $checksum_type or 
$checksum_type =~ /^\s*$/);
-                                       my $check_file = $DOWNLOADDIR . '/' . 
lc($checksum_type) . '/' . lc($checksums->{$checksum_type}) . '/' . $tarball;
-                                       if (not -f $check_file)
-                                       {
-                                               print LOG "$check_file does not 
exist, downloading\n";
-                                               $do_download = 1;
-                                       }
-                                       elsif ($VALIDATE_EXISTING_FILES)
-                                       {
-                                               if (not 
Fink::Checksum->validate($check_file, $checksums->{$checksum_type}, 
$checksum_type))
-                                               {
-                                                       print LOG "checksum on 
$check_file does not match, downloading\n";
-                                                       $do_download = 1;
-                                               }
-                                       }
-                               }
-                               if ($do_download)
-                               {
-                                       print LOG "downloading\n";
-                                       my $master_checksum_type = 'MD5';
-                                       if (not exists $checksums->{'MD5'})
-                                       {
-                                               my @types = sort keys 
%$checksums;
-                                               $master_checksum_type = 
shift(@types);
-                                       }
-                                       my $download_path = $DOWNLOADDIR . '/' 
. lc($master_checksum_type) . '/' . $checksums->{$master_checksum_type};
-                                       my $url = $package->get_source($suffix);
-                                       my $returnval = &fetch_url_to_file({
-                                               url                => $url,
-                                               filename           => $tarball,
-                                               custom_mirror      => 
$package->get_custom_mirror($suffix),
-                                               skip_master_mirror => 1,
-                                               download_directory => 
$download_path,
-                                               checksum           => 
$checksums->{$master_checksum_type},
-                                               checksum_type      => 
$master_checksum_type,
-                                               try_all_mirrors    => 1,
-                                       });
-                                       if ($returnval != 0)
-                                       {
-                                               unlink($download_path . '/' . 
$tarball);
-                                               print LOG "unable to download 
$url to $download_path\n";
-                                               $all_downloads_passed = 0;
-                                               next;
-                                       }
-       
-                                       my $file_checksums = 
Fink::Checksum->get_all_checksums($download_path . '/' . $tarball);
-                                       for my $checksum_type (keys 
%$file_checksums)
-                                       {
-                                               if ($checksum_type eq 
$master_checksum_type)
-                                               {
-                                                       if 
($file_checksums->{$checksum_type} ne $checksums->{$checksum_type})
-                                                       {
-                                                               print LOG 
"downloaded file has a different checksum than expected 
($file_checksums->{$checksum_type} ne $checksums->{$checksum_type})\n";
-                                                       }
-                                               }
-                                               else
-                                               {
-                                                       mkpath($DOWNLOADDIR . 
'/' . lc($checksum_type) . '/' . lc($file_checksums->{$checksum_type}));
-                                                       symlink(
-                                                               '../../' . 
lc($master_checksum_type) . '/' . lc($checksums->{$master_checksum_type}) . '/' 
. $tarball,
-                                                               $DOWNLOADDIR . 
'/' . lc($checksum_type) . '/' . lc($file_checksums->{$checksum_type}) . '/' . 
$tarball
-                                                       );
-                                                       unlink( $DOWNLOADDIR . 
'/' . $tarball );
-                                                       symlink(
-                                                               
lc($master_checksum_type) . '/' . lc($checksums->{$master_checksum_type}) . '/' 
. $tarball,
-                                                               $DOWNLOADDIR . 
'/' . $tarball,
-                                                       );
-                                               }
-                                       }
-                               }
-                               else
-                               {
-                                       print LOG "exists\n";
-                               }
                        }
                }
        }


------------------------------------------------------------------------------
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to