diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2020-04-28 09:45:32 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2020-04-28 09:45:52 -0700 |
commit | 34db670aff7f8da1eb1c90b7ad68cec526cfb4c6 (patch) | |
tree | 786b7689bb8bdd0835e82be6b1e46c0808745b10 | |
parent | Fix the url for releases and experimental mirrors (diff) | |
download | gentoo-mirrorstats-34db670aff7f8da1eb1c90b7ad68cec526cfb4c6.tar.gz gentoo-mirrorstats-34db670aff7f8da1eb1c90b7ad68cec526cfb4c6.tar.bz2 gentoo-mirrorstats-34db670aff7f8da1eb1c90b7ad68cec526cfb4c6.zip |
probe-mirmon: fix rsync case
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-x | probe-mirmon | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/probe-mirmon b/probe-mirmon index 7b57923..ddd8546 100755 --- a/probe-mirmon +++ b/probe-mirmon @@ -17,6 +17,8 @@ main(@ARGV); +use strict; +use warnings; use Date::Parse (); # dev-perl/TimeDate use File::Tempdir; # dev-perl/File-Tempdir @@ -56,19 +58,20 @@ sub handle_rsync { exit 900; # rediculous exit code. }; - print munge_date(<fh>); + print munge_date(<$fh>); exit 0; } sub munge_date { - my $timestr = $_; + no warnings 'numeric'; ## no critic (TestingAndDebugging::ProhibitNoWarnings) + my $timestr = shift; my $timestamp = int($timestr); my $year2020 = 1577836800; my $year2038 = 2145916800; # If the string starts with an epoch, just use that - if($int_timestamp >= $year2020 && $int_timestamp <= $year2038) { - return $int_timestamp; + if($timestamp >= $year2020 && $timestamp <= $year2038) { + return $timestamp; } else { return Date::Parse::str2time($timestr); } |