Changeset 772


Ignore:
Timestamp:
2005-04-30T21:47:17+02:00 (13 years ago)
Author:
nbd
Message:

fix mirror order in download script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openwrt/scripts/download.pl

    r736 r772  
    66my $filename = shift @ARGV; 
    77my $md5sum = shift @ARGV; 
    8 my @mirrors = @ARGV; 
     8my @mirrors; 
    99 
    1010my $ok; 
    1111 
    12 @mirrors > 0 or die "Syntax: $0 <target dir> <filename> <md5sum> <mirror> [<mirror> ...]\n"; 
    13  
    14 push @mirrors, 'http://openwrt.inf.fh-brs.de/mirror'; 
     12@ARGV > 0 or die "Syntax: $0 <target dir> <filename> <md5sum> <mirror> [<mirror> ...]\n"; 
    1513 
    1614sub download 
     
    5755} 
    5856 
    59 while (!$ok) { 
    60         my $mirror = shift @mirrors; 
    61         $mirror or die "No more mirrors to try - giving up.\n"; 
    62          
     57foreach my $mirror (@ARGV) { 
    6358        if ($mirror =~ /^\@SF\/(.+)$/) { 
    6459                my $sfpath = $1; 
     
    7166                close SF; 
    7267        } else { 
    73                 download($mirror); 
     68                push @mirrors, $mirror; 
    7469        } 
     70} 
     71 
     72push @mirrors, 'http://openwrt.inf.fh-brs.de/mirror'; 
     73 
     74while (!$ok) { 
     75        my $mirror = shift @mirrors; 
     76        $mirror or die "No more mirrors to try - giving up.\n"; 
     77         
     78        download($mirror); 
    7579        -f "$target/$filename" and $ok = 1; 
    7680} 
Note: See TracChangeset for help on using the changeset viewer.