X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=src%2Fpakfire%2Flib%2Ffunctions.pl;h=c8febe76e6dfd6201a5187d1592d14f425b18ab5;hp=1080b0062136a9fe8400bb5529667c250872ab53;hb=28593a79c2db39a88e28e3e22be975eaa028fb21;hpb=c506cad0de6bf98a3bb779fa607adcbb56b476c0 diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index 1080b00621..c8febe76e6 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -118,7 +118,7 @@ sub pinghost { $p = Net::Ping->new(); if ($p->ping($host)) { - logger("PING INFO: $host is alive"); + logger("PING INFO: $host is alive"); return 1; } else { logger("PING INFO: $host is unreachable"); @@ -211,6 +211,9 @@ sub fetchfile { move("$Conf::tmpdir/$bfile","$Conf::cachedir/$bfile"); } else { message("DOWNLOAD ERROR: The downloaded file ($file) wasn't verified by IPFire.org. Sorry - Exiting..."); + my $ntp = `ntpdate -q -t 10 pool.ntp.org 2>/dev/null | tail -1`; + if ( $ntp !~ /time\ server(.*)offset(.*)/ ){message("TIME ERROR: Unable to get the nettime, this may lead to the verification error.");} + else { $ntp =~ /time\ server(.*)offset(.*)/; message("TIME INFO: Time Server$1has$2 offset to localtime.");} exit 1; } logger("DOWNLOAD FINISHED: $file"); @@ -544,7 +547,12 @@ sub cleanup { sub getmetafile { my $pak = shift; - unless ( -e "$Conf::dbdir/meta/meta-$pak") { + unless ( -e "$Conf::dbdir/meta/meta-$pak" ) { + fetchfile("meta/meta-$pak", ""); + move("$Conf::cachedir/meta-$pak", "$Conf::dbdir/meta/meta-$pak"); + } + + if ( -z "$Conf::dbdir/meta/meta-$pak" ) { fetchfile("meta/meta-$pak", ""); move("$Conf::cachedir/meta-$pak", "$Conf::dbdir/meta/meta-$pak"); }