Commit 34f11af9 authored by amnesia's avatar amnesia

New htpdate script (43f5f83c0)

parent 0b6c15b0
......@@ -32,6 +32,7 @@ use DateTime;
use DateTime::Format::DateParse;
use English qw( -no_match_vars );
use Fatal qw( open close );
use File::Path qw(rmtree);
use File::Temp qw/tempdir/;
use Getopt::Std;
use open qw{:utf8 :std};
......@@ -189,9 +190,12 @@ sub getRemoteDateDiff {
my $newestdt;
eval { $newestdt = newestDateHeader($tmpdir) };
if ($EVAL_ERROR =~ m/No downloaded files can be found/) {
rmtree($tmpdir);
error "No file could be downloaded from $url.";
}
rmtree($tmpdir);
defined $newestdt or error "Could not get any Date header";
my $diffdt = $newestdt - $localdt;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment