X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=src%2Fpakfire%2Flib%2Ffunctions.pl;fp=src%2Fpakfire%2Flib%2Ffunctions.pl;h=4d9854a6fd9ce3b53d71959702d3a70ad078bfa5;hp=f46c9acc138032301df5cffa0865f34deb6b43c6;hb=ec18a1ecae60c6c3b6418e300aebd6a823844c8d;hpb=56702858529ae1bf75e21da3ef00f136bacedfcd diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index f46c9acc13..4d9854a6fd 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -30,6 +30,7 @@ use HTTP::Headers; use HTTP::Message; use HTTP::Request; use Net::Ping; +use URI; use Switch; @@ -297,6 +298,17 @@ sub valid_signature($) { } sub selectmirror { + if (defined ${Conf::mirror}) { + my $uri = URI->new("${Conf::mirror}"); + + # Only accept HTTPS mirrors + if ($uri->scheme eq "https") { + return ("HTTPS", $uri->host, $uri->path . "/" . ${Conf::version}); + } else { + message("MIRROR ERROR: Unsupported mirror: " . ${Conf::mirror}); + } + } + ### Check if there is a current server list and read it. # If there is no list try to get one. my $count = 0;