X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=src%2Fpakfire%2Flib%2Ffunctions.pl;h=d2ad7e34a479ebc53850648a78e7437a316288cf;hp=c8febe76e6dfd6201a5187d1592d14f425b18ab5;hb=d59b02f177dce0e077da5256eee68d2cf10b2bfd;hpb=b2576777e613e99d6fb5b1dc0b065526203cde3e diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index c8febe76e6..d2ad7e34a4 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -311,6 +311,7 @@ sub selectmirror { # This will never give up. my $found = 0; my $servers = 0; + my $pingdelay = 1; while ($found == 0) { $server = int(rand($scount) + 1); $servers = 0; @@ -323,9 +324,20 @@ sub selectmirror { $proto = $templine[0]; $host = $templine[1]; $path = $templine[2]; - if (pinghost("$host")) { + if ($pakfiresettings{'HEALTHCHECK'} eq "off") { + logger("PING INFO: Healthcheck is disabled"); $found = 1; return ($proto, $host, $path); + elsif (pinghost("$host")) { + $found = 1; + return ($proto, $host, $path); + } + if ($found == 0) { + sleep($pingdelay); + $pingdelay=$pingdelay*2; + if ($pingdelay>1200) { + $pingdelay=1200; + } } } } @@ -381,7 +393,7 @@ sub dblist { close(FILE); if ("$filter" eq "upgrade") { - getcoredb("noforce"); + if ("$forweb" ne "forweb") {getcoredb("noforce");} eval(`grep "core_" $Conf::dbdir/lists/core-list.db`); if ("$core_release" > "$Conf::core_mine") { if ("$forweb" eq "forweb") { @@ -396,13 +408,14 @@ sub dblist { } } - opendir(DIR,"$Conf::dbdir/meta"); + opendir(DIR,"$Conf::dbdir/installed"); my @files = readdir(DIR); closedir(DIR); foreach $file (@files) { next if ( $file eq "." ); next if ( $file eq ".." ); - open(FILE, "<$Conf::dbdir/meta/$file"); + next if ( $file =~ /^old/ ); + open(FILE, "<$Conf::dbdir/installed/$file"); @meta = ; close(FILE); foreach $line (@meta) {