Bugzilla – Attachment 90713 Details for
Bug 16349
Indicate what branches of Koha are supported
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16349: Scrape currently supported versions
Bug-16349-Scrape-currently-supported-versions.patch (text/plain), 3.63 KB, created by
Mark Tompsett
on 2019-06-18 02:34:05 UTC
(
hide
)
Description:
Bug 16349: Scrape currently supported versions
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2019-06-18 02:34:05 UTC
Size:
3.63 KB
patch
obsolete
>From 7fd63f33afc8dc5177ccc254ddd9de7737c139b8 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Tue, 18 Jun 2019 02:21:34 +0000 >Subject: [PATCH] Bug 16349: Scrape currently supported versions > >Before patch: Koha -> About -> Server Information >- Only the currently running version > >After patch: >- Currently supported versions are listed > >Are you sure you just want it on the web page and not >in Koha itself? >--- > C4/Context.pm | 1 + > Koha.pm | 14 ++++++++++++++ > about.pl | 1 + > koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 9 ++++++++- > 4 files changed, 24 insertions(+), 1 deletion(-) > >diff --git a/C4/Context.pm b/C4/Context.pm >index fa612472f7..9b1272e9f2 100644 >--- a/C4/Context.pm >+++ b/C4/Context.pm >@@ -939,6 +939,7 @@ Gets various version info, for core Koha packages, Currently called from carp ha > # A little example sub to show more debugging info for CGI::Carp > sub get_versions { > my %versions; >+ $versions{supportedVersions} = Koha::current_versions(); > $versions{kohaVersion} = Koha::version(); > $versions{kohaDbVersion} = C4::Context->preference('version'); > $versions{osVersion} = join(" ", POSIX::uname()); >diff --git a/Koha.pm b/Koha.pm >index 1553fbdb0d..fc449d6a2f 100644 >--- a/Koha.pm >+++ b/Koha.pm >@@ -19,6 +19,7 @@ package Koha; > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+use WWW::Mechanize; > > use vars qw{ $VERSION }; > >@@ -35,6 +36,19 @@ sub version { > return $VERSION; > } > >+sub current_versions { >+ my $mechanical_scrapper = WWW::Mechanize->new(); >+ my @links; >+ eval { >+ $mechanical_scrapper->get('http://download.koha-community.org/'); >+ @links = $mechanical_scrapper->links(); >+ }; >+ my @urls_only = map { $_->url } @links; >+ my @versions = grep { if ($_ =~ /(koha-)([.0-9]*)(.tar.gz)$/) { $_ = $2; } } @urls_only; >+ my @sorted_versions = sort { $b cmp $a } @versions; >+ return \@sorted_versions; >+} >+ > 1; > > =head1 NAME >diff --git a/about.pl b/about.pl >index dacd39db2d..188ffbe19f 100755 >--- a/about.pl >+++ b/about.pl >@@ -447,6 +447,7 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; > my %versions = C4::Context::get_versions(); > > $template->param( >+ supportedVersions => $versions{'supportedVersions'}, > kohaVersion => $versions{'kohaVersion'}, > osVersion => $versions{'osVersion'}, > perlPath => $perl_path, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index 60ce4ac21d..8031236da5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -34,7 +34,14 @@ > > <table> > <caption>Server information</caption> >- <tr><th scope="row">Koha version: </th><td>[% kohaVersion | html %]</td></tr> >+ <tr><th scope="row">Koha version: </th><td>[% kohaVersion | html %]<br /> >+ <br /> >+ <strong>Currently Supported Versions</strong><br /> >+ [% FOREACH supportedVersion IN supportedVersions %] >+ [% supportedVersion | html %]<br /> >+ [% END %] >+ [% IF supportedVersions.size < 1 %]Unknown[% END %] >+ </td></tr> > <tr><th scope="row">OS version ('uname -a'): </th><td>[% osVersion | html %]</td></tr> > <tr><th scope="row">Perl interpreter: </th><td>[% perlPath | html %]</td></tr> > <tr><th scope="row">Perl version: </th><td>[% perlVersion | html %]</td></tr> >-- >2.11.0
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 16349
:
90713
|
91845