From: Mischa POSLAWSKY Date: Tue, 14 Feb 2023 23:25:14 +0000 (+0100) Subject: perl: optional recommendations at ?at timestamp X-Git-Tag: v1.14~28 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/bb06ade4941ab8a981256d06b1d1a36a5564c690 perl: optional recommendations at ?at timestamp --- diff --git a/perl.plp b/perl.plp index c227a9c..b1ea1c7 100644 --- a/perl.plp +++ b/perl.plp @@ -33,23 +33,26 @@ eval { use Time::Seconds; my $now = Time::Piece->new; + $now = $now->strptime($_, '%Y-%m-%d') for $get{at} // (); + my $coreeol = ($now - ONE_YEAR * 3)->strftime('%F'); my $vcore = first { $info->{$_}{release} ge $coreeol } sort keys %{$info}; - say "

Core security support is provided for 3 years", - ", so typical users should run at least $_." - for linkversion($vcore); + print "

Core security support is provided for 3 years"; + print ", so typical users should run at least ", linkversion($_) + for $vcore // (); + say '.'; my $vendoreol = ($now - ONE_YEAR * 5)->strftime('%F'); my $vdebian = first { $info->{$_}{release} ge $vendoreol && $info->{$_}{distro}{debian} } sort keys %{$info}; say sprintf "Stable distributions such as Debian %s maintain %s+.", - $info->{$_}{distro}{debian}, linkversion($_) for $vdebian; + $info->{$_}{distro}{debian}, linkversion($_) for $vdebian // (); my $nowcmp = $now->strftime('%F'); my $vdino = first { $info->{$_}{support} ge $nowcmp } sort keys %{$info}; say "Enterprise platforms retain versions up to $_." - for linkversion($vdino); + for map { linkversion($_) } $vdino // (); return 1; } or Alert('Missing version recommendations', $@); say '

';