From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9F839138350 for ; Tue, 28 Apr 2020 16:46:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DDE42E0903; Tue, 28 Apr 2020 16:46:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BF681E0903 for ; Tue, 28 Apr 2020 16:46:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B792834EF79 for ; Tue, 28 Apr 2020 16:46:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 790BC18F for ; Tue, 28 Apr 2020 16:46:44 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1588092352.34db670aff7f8da1eb1c90b7ad68cec526cfb4c6.robbat2@gentoo> Subject: [gentoo-commits] proj/gentoo-mirrorstats:master commit in: / X-VCS-Repository: proj/gentoo-mirrorstats X-VCS-Files: probe-mirmon X-VCS-Directories: / X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 34db670aff7f8da1eb1c90b7ad68cec526cfb4c6 X-VCS-Branch: master Date: Tue, 28 Apr 2020 16:46:44 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: eb20a890-1d25-462e-94d3-948a62ef2ac9 X-Archives-Hash: 7edbc47f368f9a84416ffcb43b61b2a9 commit: 34db670aff7f8da1eb1c90b7ad68cec526cfb4c6 Author: Robin H. Johnson gentoo org> AuthorDate: Tue Apr 28 16:45:32 2020 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Tue Apr 28 16:45:52 2020 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=34db670a probe-mirmon: fix rsync case Signed-off-by: Robin H. Johnson gentoo.org> probe-mirmon | 11 +++++++---- 1 file 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(); + 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); }