Bugzilla – Attachment 98577 Details for
Bug 19735
Move Perl deps definitions into a cpanfile
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19735: Add support for max_ver
Bug-19735-Add-support-for-maxver.patch (text/plain), 5.66 KB, created by
Martin Renvoize (ashimema)
on 2020-02-07 17:34:12 UTC
(
hide
)
Description:
Bug 19735: Add support for max_ver
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-02-07 17:34:12 UTC
Size:
5.66 KB
patch
obsolete
>From c742f82167a2b30b87105dd27f2f752538d82d0b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 7 Feb 2020 16:51:33 +0000 >Subject: [PATCH] Bug 19735: Add support for max_ver > >--- > C4/Installer/PerlModules.pm | 12 ++++++- > installer/install.pl | 34 ++++++++++++++----- > .../prog/en/modules/installer/step1.tt | 16 ++++++++- > 3 files changed, 52 insertions(+), 10 deletions(-) > >diff --git a/C4/Installer/PerlModules.pm b/C4/Installer/PerlModules.pm >index f76bb4a38b..3f13c47ffd 100644 >--- a/C4/Installer/PerlModules.pm >+++ b/C4/Installer/PerlModules.pm >@@ -60,10 +60,20 @@ sub versions_info { > > my $module_infos = { > cur_ver => 0, >- min_ver => $reqs->requirements_for_module($module), > required => $type eq 'requires', > }; > >+ my $vers = $reqs->structured_requirements_for_module($module); >+ for my $req (@$vers) { >+ if ( $req->[0] eq '>=' || $req->[0] eq '>' ) { >+ $module_infos->{min_ver} = $req->[1]; >+ } elsif ( $req->[0] eq '<=' || $req->[0] eq '<' ) { >+ $module_infos->{max_ver} = $req->[1]; >+ } else { >+ push @{$module_infos->{exc_ver}}, $req->[1]; >+ } >+ } >+ > my $attr; > > $Readonly::XS::MAGIC_COOKIE="Do NOT use or require Readonly::XS unless you're me."; >diff --git a/installer/install.pl b/installer/install.pl >index c9e119d6bc..851accb319 100755 >--- a/installer/install.pl >+++ b/installer/install.pl >@@ -101,24 +101,42 @@ if ( $step && $step == 1 ) { > my $perl_modules = C4::Installer::PerlModules->new; > $perl_modules->versions_info; > >- my $modules = $perl_modules->get_attr('missing_pm'); >- if ( scalar(@$modules) ) { >- my @components = (); >- foreach (@$modules) { >+ my $missing_modules = $perl_modules->get_attr('missing_pm'); >+ my $upgrade_modules = $perl_modules->get_attr('upgrade_pm'); >+ if ( scalar(@$missing_modules) || scalar(@$upgrade_modules) ) { >+ my @missing = (); >+ my @upgrade = (); >+ foreach (@$missing_modules) { > my ( $module, $stats ) = each %$_; > $checkmodule = 0 if $stats->{'required'}; > push( >- @components, >+ @missing, > { > name => $module, >- version => $stats->{'min_ver'}, >+ min_version => $stats->{'min_ver'}, >+ max_version => $stats->{'max_ver'}, > require => $stats->{'required'} > } > ); > } >- @components = sort { $a->{'name'} cmp $b->{'name'} } @components; >+ foreach (@$upgrade_modules) { >+ my ( $module, $stats ) = each %$_; >+ $checkmodule = 0 if $stats->{'required'}; >+ push( >+ @upgrade, >+ { >+ name => $module, >+ min_version => $stats->{'min_ver'}, >+ max_version => $stats->{'max_ver'}, >+ require => $stats->{'required'} >+ } >+ ); >+ } >+ @missing = sort { $a->{'name'} cmp $b->{'name'} } @missing; >+ @upgrade = sort { $a->{'name'} cmp $b->{'name'} } @upgrade; > $template->param( >- missing_modules => \@components, >+ missing_modules => \@missing, >+ upgrade_modules => \@upgrade, > checkmodule => $checkmodule, > op => $op > ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt >index 339af4fff3..d314036b99 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt >@@ -61,7 +61,21 @@ > <ul> > [% FOREACH missing_module IN missing_modules %] > <li><strong>[% missing_module.name | html %]</strong> [% IF ( missing_module.require ) %]<span class="label label-danger">Required</span>[% END %] >- <br /> Version: [% missing_module.version | html %] >+ <br /> Version: [% missing_module.min_version | html %] >+ </li> >+ [% END %] >+ </ul> >+ [% END %] >+ >+ [% IF ( upgrade_modules ) %] >+ <h2>Web installer › Perl modules due for upgrade</h2> >+ <p>Some Perl modules require upgrade. <span class="label label-danger">Important: </span>Required modules must be installed at the correct version before you may continue.<br /> >+ <ul> >+ [% FOREACH upgrade_module IN upgrade_modules %] >+ <li><strong>[% upgrade_module.name | html %]</strong> [% IF ( upgrade_module.require ) %]<span class="label label-danger">Required</span>[% END %] >+ <br /> Installed version: [% upgrade_module.version | html %] >+ <br /> Minimum version: [% upgrade_module.min_version | html %] >+ <br /> Maximum version: [% upgrade_module.max_version | html %] > </li> > [% END %] > </ul> >-- >2.20.1
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 19735
:
69465
|
69466
|
73837
|
73838
|
81612
|
97484
|
97485
|
98568
|
98569
|
98570
|
98576
|
98577
|
98636
|
98637
|
98638
|
98639
|
98640
|
98743
|
98744
|
98745
|
98746
|
98747
|
98748