1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!/usr/bin/perl -spi
# turn mirror list into http links
BEGIN{
use FileHandle;
$f = "<!-- MIRRORSTART -->\n";
my $MIRRORS = shift;
if( not $MIRRORS or not $ARGV[0] ){
print STDERR "use: $0 Mirrorlist Updatefile\n";
exit 1;
}
my($m);
$m = FileHandle->new("<$MIRRORS") or die "cannot open $MIRRORS";
while( <$m> ){
my ($site,$where) = split;
$f .= <<EOF ;
<br><a href="$site">$site</a> $where
EOF
}
close($m);
$f .= "<!-- MIRROREND -->\n";
}
if( /MIRRORSTART/../MIRROREND/ ){
$_ = "";
if( !$done ){
print $f;
$done = 1;
}
}
|