diff options
author | Michael Orlitzky <mjo@gentoo.org> | 2017-08-24 09:21:28 -0400 |
---|---|---|
committer | Michael Orlitzky <mjo@gentoo.org> | 2017-08-24 09:21:41 -0400 |
commit | 0fde279c363ed228d5a1eae8716a5c236c48e084 (patch) | |
tree | be8deada5f3213a2ba8a8a0942bcfb4472537c02 /net-mail/postfix-logwatch/files | |
parent | www-client/seamonkey: Use latest firefox-esr patchset. (diff) | |
download | gentoo-0fde279c363ed228d5a1eae8716a5c236c48e084.tar.gz gentoo-0fde279c363ed228d5a1eae8716a5c236c48e084.tar.bz2 gentoo-0fde279c363ed228d5a1eae8716a5c236c48e084.zip |
net-mail/postfix-logwatch: new revision with some bugfix patches.
Upstream development has stalled for this package, so we now include a
few patches needed to support modern versions of perl.
Package-Manager: Portage-2.3.6, Repoman-2.3.1
Diffstat (limited to 'net-mail/postfix-logwatch/files')
-rw-r--r-- | net-mail/postfix-logwatch/files/redundant-argument-to-sprintf.patch | 48 | ||||
-rw-r--r-- | net-mail/postfix-logwatch/files/unescaped-left-brace.patch | 37 |
2 files changed, 85 insertions, 0 deletions
diff --git a/net-mail/postfix-logwatch/files/redundant-argument-to-sprintf.patch b/net-mail/postfix-logwatch/files/redundant-argument-to-sprintf.patch new file mode 100644 index 000000000000..ee0e79bd41d9 --- /dev/null +++ b/net-mail/postfix-logwatch/files/redundant-argument-to-sprintf.patch @@ -0,0 +1,48 @@ +From 6afb8e258a5a2a0e7c72c4c25927dde9d1e2ad89 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky <michael@orlitzky.com> +Date: Thu, 24 Aug 2017 07:34:36 -0400 +Subject: [PATCH 2/2] Fix redundant argument to sprintf warning. + +Perl 5.22 now warns about redundant (i.e. extra) arguments to the +sprintf function. If your format string only has two place-holders but +you pass three place-fillers, you get warned: + + Redundant argument in sprintf at ./postfix-logwatch line 1382... + +The issue there was that the format string passed to sprintf was +constructed dynamically; sometimes it would contain two place-holders, +and sometimes three. Three place-fillers were always passed, so when +only two place-holders were used, the warning would be thrown. This was +fixed by testing whether or not there are two or three place-holders, +and passing the appropriate number of place-fillers. +--- + postfix-logwatch | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/postfix-logwatch b/postfix-logwatch +index 1e58a95..92ed621 100644 +--- a/postfix-logwatch ++++ b/postfix-logwatch +@@ -1378,8 +1378,17 @@ sub print_summary_report (\@) { + $$divisor == $Totals{$keyname} ? 100.00 : $Totals{$keyname} * 100 / $$divisor; + } + else { +- push @{$lines[$cur_level]}, +- sprintf "$fmt %-23s $extra\n", $total, $desc, commify ($Totals{$keyname}); ++ my $new_line; ++ if ($extra eq '') { ++ $new_line = sprintf("$fmt %-23s \n", $total, $desc); ++ } ++ else { ++ $new_line = sprintf("$fmt %-23s $extra\n", ++ $total, ++ $desc, ++ commify ($Totals{$keyname})); ++ } ++ push @{$lines[$cur_level]}, $new_line + } + } + } +-- +2.13.0 + diff --git a/net-mail/postfix-logwatch/files/unescaped-left-brace.patch b/net-mail/postfix-logwatch/files/unescaped-left-brace.patch new file mode 100644 index 000000000000..65139a3aff14 --- /dev/null +++ b/net-mail/postfix-logwatch/files/unescaped-left-brace.patch @@ -0,0 +1,37 @@ +From 84f9fb47783e63757f27e5990ee606ff01e079a9 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky <michael@orlitzky.com> +Date: Thu, 24 Aug 2017 07:09:28 -0400 +Subject: [PATCH 1/2] Fix unescaped left brace warning for "Config: {". + +New versions of Perl are starting to complain about unescaped braces +in regular expressions, and supposedly the warning will become a fatal +error in Perl 5.30. This particular warning is, + + Unescaped left brace in regex is deprecated, passed through in regex; + marked by <-- HERE in m/^Config: { <-- HERE / at ./postfix-logwatch + line 1850. + +and it was fixed by going to line 1850 and putting a backslash before +the left brace. + +Bug: https://sourceforge.net/p/logreporters/bugs/4/ +--- + postfix-logwatch | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/postfix-logwatch b/postfix-logwatch +index 3e4a673..1e58a95 100644 +--- a/postfix-logwatch ++++ b/postfix-logwatch +@@ -1847,7 +1847,7 @@ sub postfix_policy_spf($) { + # KeyboardInterrupt + $line =~ /^Read line: "/ or + $line =~ /^Found the end of entry$/ or +- $line =~ /^Config: {/ or ++ $line =~ /^Config: \{/ or + $line =~ /^spfcheck: pyspf result/ or + $line =~ /^Starting$/ or + $line =~ /^Normal exit$/ or +-- +2.13.0 + |