Bugzilla – Attachment 38531 Details for
Bug 13767
Readonly::XS (1:02) is not installed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13767: Fix Readonly::XS version detection
Bug-13767-Fix-ReadonlyXS-version-detection.patch (text/plain), 3.29 KB, created by
Mark Tompsett
on 2015-04-27 07:36:56 UTC
(
hide
)
Description:
Bug 13767: Fix Readonly::XS version detection
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-04-27 07:36:56 UTC
Size:
3.29 KB
patch
obsolete
>From 4d2e1c7ac126611509fd8d901588e83c29f5da6a Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Sun, 26 Apr 2015 21:15:29 -0400 >Subject: [PATCH] Bug 13767: Fix Readonly::XS version detection > >The about.pl screen is unable to see that version 1.05-1+b1 is >installed because eval "require Readonly::XS" returns an error >message telling you that you can't use Readonly::XS directly. > >Since it is the only one, we attempt to use /usr/bin/dpkg to >determine the version number. > >TEST PLAN >--------- >1) $ dpkg -l libreadonly-xs-perl > -- note the version number >2) Log in to staff client >3) About Koha -> Perl modules > -- note it says Readonly::XS is not installed. > -- note the versions and colours of the other modules. >4) Apply patch >5) Reload page and go to Perl modules tab > -- Readonly::XS should list the version noted in step 1. > -- the other modules' output should be unchanged. >6) Run koha qa test tools > >All systems running Koha will have perldoc installed. :) >--- > C4/Installer/PerlModules.pm | 29 ++++++++++++++++++++++++++++- > 1 file changed, 28 insertions(+), 1 deletion(-) > >diff --git a/C4/Installer/PerlModules.pm b/C4/Installer/PerlModules.pm >index 2f40cf5..c3cdae3 100644 >--- a/C4/Installer/PerlModules.pm >+++ b/C4/Installer/PerlModules.pm >@@ -4,6 +4,7 @@ use warnings; > use strict; > > use File::Spec; >+use Data::Dumper; > > use C4::Installer::PerlDependencies; > >@@ -80,8 +81,34 @@ sub version_info { > } > } > else { >- for (sort keys(%{$PERL_DEPS})) { >+ my $Readonly_XS_Version; >+ PERLDEP: for (sort keys(%{$PERL_DEPS})) { > my $pkg = $_; # $_ holds the string >+ if ($pkg eq 'Readonly::XS') { >+ my @data; >+ eval { >+ @data = >+ `/usr/bin/perldoc -m Readonly::XS`; >+ }; >+ if (@data) { >+ my @filtered = grep { $_ =~ /\$VERSION\s*=\s*['"]/ } @data; >+ if (@filtered) { >+ my $line = $filtered[0]; >+ my @data = split(/['"]/,$line); >+ $Readonly_XS_Version = $data[1]; >+ } >+ } >+ if (!$Readonly_XS_Version) { >+ push (@{$self->{'missing_pm'}}, {$_ => {cur_ver => 0, min_ver => $PERL_DEPS->{$_}->{'min_ver'}, required => $PERL_DEPS->{$_}->{'required'}, usage => $PERL_DEPS->{$_}->{'usage'}}}); >+ } >+ elsif ($Readonly_XS_Version lt $PERL_DEPS->{$_}->{'min_ver'}) { >+ push (@{$self->{'upgrade_pm'}}, {$_ => {cur_ver => $Readonly_XS_Version, min_ver => $PERL_DEPS->{$_}->{'min_ver'}, required => $PERL_DEPS->{$_}->{'required'}, usage => $PERL_DEPS->{$_}->{'usage'}}}); >+ } >+ else { >+ push (@{$self->{'current_pm'}}, {$_ => {cur_ver => $Readonly_XS_Version, min_ver => $PERL_DEPS->{$_}->{'min_ver'}, required => $PERL_DEPS->{$_}->{'required'}, usage => $PERL_DEPS->{$_}->{'usage'}}}); >+ } >+ next PERLDEP; >+ } > eval "require $pkg"; > if ($@) { > push (@{$self->{'missing_pm'}}, {$_ => {cur_ver => 0, min_ver => $PERL_DEPS->{$_}->{'min_ver'}, required => $PERL_DEPS->{$_}->{'required'}, usage => $PERL_DEPS->{$_}->{'usage'}}}); >-- >2.1.4
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 13767
:
38521
|
38526
|
38527
|
38528
|
38531
|
38532