997c997
<         $link = $2 if ( $link =~ /^(.*)\/(.*)$/ );
---
>         my $rpm = $2 if ( $link =~ /^(.*)\/(.*)$/ );
1000c1000
<         next if ( $link !~ /\.rpm$/i );
---
>         next if ( $rpm !~ /\.rpm$/i );
1003c1003
<         $link = uri_unescape($link);
---
>         $rpm = uri_unescape($rpm);
1006,1008c1006,1008
<         $links{ $link } = "$mirror/$link";
<         $links{ $link } =~ s#//#/#g; # remove duplicate slashes
<         $links{ $link } =~ s#^http:/#http://#; # except for http
---
>         $links{ $rpm } = "$mirror/$link";
>         $links{ $rpm } =~ s#//#/#g; # remove duplicate slashes
>         $links{ $rpm } =~ s#^http:/#http://#; # except for http
