Bugzilla – Attachment 134961 Details for
Bug 30731
Noise from about script coming from Test::MockTime (or other CPAN modules)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30731: Silence noisy CPAN modules in C4::Installer::PerlModules
Bug-30731-Silence-noisy-CPAN-modules-in-C4Installe.patch (text/plain), 2.03 KB, created by
Katrin Fischer
on 2022-05-13 09:56:08 UTC
(
hide
)
Description:
Bug 30731: Silence noisy CPAN modules in C4::Installer::PerlModules
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2022-05-13 09:56:08 UTC
Size:
2.03 KB
patch
obsolete
>From 61570b8c08a9e6e00a59a33d6810026619ed4faf Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 11 May 2022 14:26:06 +0000 >Subject: [PATCH] Bug 30731: Silence noisy CPAN modules in > C4::Installer::PerlModules > >Main change is replacing 'no warnings' by local $SIG{__WARN__}. > >The modules are sorted now too. This will make results of requiring >them one after the other a more predictable experience and improves >the output of koha_perl_deps. > >Test plan: >Run about. Check plack intranet log. >Run koha_perl_deps.pl -a > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >--- > C4/Installer/PerlModules.pm | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/C4/Installer/PerlModules.pm b/C4/Installer/PerlModules.pm >index f143bc6cc1..a66dc03899 100644 >--- a/C4/Installer/PerlModules.pm >+++ b/C4/Installer/PerlModules.pm >@@ -54,9 +54,7 @@ sub versions_info { > foreach my $phase ($self->prereqs->phases) { > foreach my $type ($self->prereqs->types_in($phase)) { > my $reqs = $self->prereqs->requirements_for($phase, $type); >- foreach my $module ($reqs->required_modules) { >- no warnings; # perl throws warns for invalid $VERSION numbers which some modules use >- >+ foreach my $module (sort $reqs->required_modules) { > my $module_infos = { > cur_ver => 0, > required => $type eq 'requires', >@@ -76,7 +74,11 @@ sub versions_info { > my $attr; > > $Readonly::XS::MAGIC_COOKIE="Do NOT use or require Readonly::XS unless you're me."; >- eval "require $module"; >+ { >+ # ignore warnings from noisy modules >+ local $SIG{__WARN__} = sub {}; >+ eval "require $module"; >+ } > if ($@) { > $attr = 'missing_pm'; > } else { >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30731
:
134913
|
134914
|
134915
|
134917
|
134918
|
134919
|
134960
| 134961 |
134962