Bugzilla – Attachment 38874 Details for
Bug 14152
Check for required dependencies during upgrades
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14152: Re-check required dependencies during upgrade process
Bug-14152-Re-check-required-dependencies-during-up.patch (text/plain), 5.14 KB, created by
Chris Nighswonger
on 2015-05-05 19:12:07 UTC
(
hide
)
Description:
Bug 14152: Re-check required dependencies during upgrade process
Filename:
MIME Type:
Creator:
Chris Nighswonger
Created:
2015-05-05 19:12:07 UTC
Size:
5.14 KB
patch
obsolete
>From 9cfc795ef901d85d2c3e15a8521d4874dd16695e Mon Sep 17 00:00:00 2001 >From: Chris Nighswonger <chris.nighswonger@gmail.com> >Date: Tue, 5 May 2015 15:00:30 -0400 >Subject: [PATCH] Bug 14152: Re-check required dependencies during upgrade > process > >This code causes the installer to re-check dependencies during the >upgrade process. > >Test Plan: > >1. Remove a required dependency. (Such as the recently added > PDF::FromHTML and associated HTML::Tidy.) > >2. Run the installer and note that it does not catch the missing > dependency. > >3. Also note that things break badly due to the missing dependency. > >4. Apply this patch. > >5. Under Global System Preferences > Local Use > Version change the > dev revision number back one unit and save. > >6. The updater will run and catch the missing dependency. > >7. Install the missing dependency. > >8. Return to the updater and continue with the update. > >9. The update should complete successfully. >--- > C4/Auth.pm | 2 +- > installer/install.pl | 19 ++++++++++--------- > .../intranet-tmpl/prog/en/modules/installer/step1.tt | 15 ++++++++++++++- > 3 files changed, 25 insertions(+), 11 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 4b02701..f5a6d65 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -671,7 +671,7 @@ sub _version_check { > my $warning = "Database update needed, redirecting to %s. Database is $version and Koha is $kohaversion"; > if ( $type ne 'opac' ) { > warn sprintf( $warning, 'Installer' ); >- print $query->redirect("/cgi-bin/koha/installer/install.pl?step=3"); >+ print $query->redirect("/cgi-bin/koha/installer/install.pl?step=1&op=updatestructure"); > } else { > warn sprintf( "OPAC: " . $warning, 'maintenance' ); > print $query->redirect("/cgi-bin/koha/maintenance.pl"); >diff --git a/installer/install.pl b/installer/install.pl >index 1fbc685..ae506ba 100755 >--- a/installer/install.pl >+++ b/installer/install.pl >@@ -53,9 +53,10 @@ my $dbh = DBI->connect( > ); > > if ( $step && $step == 1 ) { >- #First Step >+ #First Step (for both fresh installations and upgrades) > #Checking ALL perl Modules and services needed are installed. > #Whenever there is an error, adding a report to the page >+ my $op = $query->param('op') || 'noop'; > $template->param( language => 1 ); > $template->param( 'checkmodule' => 1 ); # we start with the assumption that there are no problems and set this to 0 if there are > >@@ -84,7 +85,7 @@ if ( $step && $step == 1 ) { > ); > } > @components = sort {$a->{'name'} cmp $b->{'name'}} @components; >- $template->param( missing_modules => \@components, checkmodule => $checkmodule ); >+ $template->param( missing_modules => \@components, checkmodule => $checkmodule, op => $op ); > } > } > elsif ( $step && $step == 2 ) { >@@ -312,13 +313,13 @@ elsif ( $step && $step == 3 ) { > # > #Do updatedatabase And report > >- if ( ! defined $ENV{PERL5LIB} ) { >- my $find = "C4/Context.pm"; >- my $path = $INC{$find}; >- $path =~ s/\Q$find\E//; >- $ENV{PERL5LIB} = "$path:$path/installer"; >- warn "# plack? inserted PERL5LIB $ENV{PERL5LIB}\n"; >- } >+ if ( ! defined $ENV{PERL5LIB} ) { >+ my $find = "C4/Context.pm"; >+ my $path = $INC{$find}; >+ $path =~ s/\Q$find\E//; >+ $ENV{PERL5LIB} = "$path:$path/installer"; >+ warn "# plack? inserted PERL5LIB $ENV{PERL5LIB}\n"; >+ } > > my $now = POSIX::strftime( "%Y-%m-%dT%H:%M:%S", localtime() ); > my $logdir = C4::Context->config('logdir'); >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 038c9dc..4fb70b5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step1.tt >@@ -30,7 +30,9 @@ listed, please inform your systems administrator.</p> > </form> > [% END %] > [% IF ( language ) %] >- [% UNLESS ( checkmodule ) %] >+ [% IF ( checkmodule ) %] >+ <p>All required Perl modules appear to be installed.<br /> >+ [% ELSE %] > [% IF ( missing_modules ) %] > <p>Some Perl modules are missing. Modules in red <b>must</b> be installed before you may continue.<br /> > <ul> >@@ -57,11 +59,22 @@ listed, please inform your systems administrator.</p> > [% END %] > <form name="checkmodules" action="install.pl"> > [% IF ( checkmodule ) %] >+[% IF (op == 'noop') %] > <input type="hidden" name="step" value="2" /> >+[% ELSE %] >+<input type="hidden" name="step" value="3" /> >+<input type="hidden" name="op" value="[% op %]" /> >+<input type="hidden" name="checkmodule" value="[% checkmodule %]"/> >+[% END %] > <p> All dependencies installed.</p> > <p>Please click 'Next' to continue <input value="Next >>" type="submit" /></p> > [% ELSE %] >+[% IF (op == 'noop') %] > <input type="hidden" name="step" value="1" /> >+[% ELSE %] >+<input type="hidden" name="step" value="1" /> >+<input type="hidden" name="op" value="[% op %]" /> >+[% END %] > <p>Click to recheck dependencies <input value="Recheck" type="submit" /></p> > [% END %] > </form> >-- >1.9.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 14152
:
38874
|
38877
|
38973