Bugzilla – Attachment 90980 Details for
Bug 23191
Administrators should be able to install plugins from the command line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23191: (follow-up) Improve output
Bug-23191-follow-up-Improve-output.patch (text/plain), 2.28 KB, created by
Martin Renvoize (ashimema)
on 2019-06-25 08:23:16 UTC
(
hide
)
Description:
Bug 23191: (follow-up) Improve output
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-06-25 08:23:16 UTC
Size:
2.28 KB
patch
obsolete
>From 9cf4f5fc8475c01726b833393af6549173f94955 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 25 Jun 2019 09:21:44 +0100 >Subject: [PATCH] Bug 23191: (follow-up) Improve output > >This patch adds a check of what plugins installed before the script run >and outputs only those plugins that have been installed for the first >time or upgraded during this run. >--- > misc/devel/install_plugins.pl | 37 ++++++++++++++++++++++++++++------- > 1 file changed, 30 insertions(+), 7 deletions(-) > >diff --git a/misc/devel/install_plugins.pl b/misc/devel/install_plugins.pl >index 19ba68dbcc..6727aed70c 100755 >--- a/misc/devel/install_plugins.pl >+++ b/misc/devel/install_plugins.pl >@@ -39,9 +39,18 @@ unless ($plugins_enabled) { > exit 1; > } > >-my @plugins = Koha::Plugins->new()->InstallPlugins(); > >-unless (@plugins) { >+my @existing_plugins = Koha::Plugins->new()->GetPlugins({ >+ all => 1, >+}); >+my $existing_plugins; >+for my $existing_plugin (@existing_plugins) { >+ $existing_plugins->{ $existing_plugin->{metadata}->{name} } = >+ $existing_plugin->{metadata}->{version}; >+} >+ >+my @installed_plugins = Koha::Plugins->new()->InstallPlugins(); >+unless (@installed_plugins) { > my $plugins_dir = C4::Context->config("pluginsdir"); > if ( ref($plugins_dir) eq 'ARRAY' ) { > print "No plugins found\n"; >@@ -52,11 +61,25 @@ unless (@plugins) { > } > } > >-for my $plugin (@plugins) { >- print "Installed " >- . $plugin->{metadata}->{name} >- . " version " >- . $plugin->{metadata}->{version} . "\n"; >+for my $installed_plugin (@installed_plugins) { >+ if ( !exists( $existing_plugins->{ $installed_plugin->{metadata}->{name} } ) >+ ) >+ { >+ print "Installed " >+ . $installed_plugin->{metadata}->{name} >+ . " version " >+ . $installed_plugin->{metadata}->{version} . "\n"; >+ } >+ elsif ( $existing_plugins->{ $installed_plugin->{metadata}->{name} } ne >+ $installed_plugin->{metadata}->{version} ) >+ { >+ print "Upgraded " >+ . $installed_plugin->{metadata}->{name} >+ . " from version " >+ . $existing_plugins->{ $installed_plugin->{metadata}->{name} } >+ . " to version " >+ . $installed_plugin->{metadata}->{version} . "\n"; >+ } > } > > =head1 NAME >-- >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 23191
:
90943
|
90946
|
90979
|
90980
|
90981
|
90985
|
90986