Bug 36517

Summary: Fix output from install_plugins.pl
Product: Koha Reporter: Magnus Enger <magnus>
Component: Command-line UtilitiesAssignee: Magnus Enger <magnus>
Status: Pushed to oldstable --- QA Contact: Emily Lamancusa (emlam) <emily.lamancusa>
Severity: trivial    
Priority: P5 - low CC: dcook, emily.lamancusa, fridolin.somers, lucas, robin
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.06,23.05.12
Circulation function:
Attachments: Bug 36517: Fix output from install_plugins.pl
Bug 36517: Fix output from install_plugins.pl
Bug 36517: Fix output from install_plugins.pl

Description Magnus Enger 2024-04-04 09:23:09 UTC
To recreate in KTD: 

Edit koha-conf.xml and duplicate the <pluginsdir> line:

sudo vim /etc/koha/sites/kohadev/koha-conf.xml

 <pluginsdir>/var/lib/koha/kohadev/plugins</pluginsdir> <!-- This entry can be repeated to use multiple directories -->
 <pluginsdir>/var/lib/koha/kohadev/plugins</pluginsdir> <!-- This entry can be repeated to use multiple directories -->

Then cd into the "koha" directory and run the script. It will look like this: 

root@kohadevbox:kohadevbox$ cd /kohadevbox/koha
root@kohadevbox:koha$ perl misc/devel/install_plugins.pl
No plugins found
pluginsdir contains: 
/var/lib/koha/kohadev/plugins\n/var/lib/koha/kohadev/pluginskoha-plugin-librisld/root@kohadevbox:koha$

Note there is a literal \n between the two directories listed, and no newline after the last directory.
Comment 1 Magnus Enger 2024-04-04 09:24:15 UTC
Sorry, this is what running the script will look like: 

$ perl misc/devel/install_plugins.pl
No plugins found
pluginsdir contains: 
/var/lib/koha/kohadev/plugins\n/var/lib/koha/kohadev/pluginsroot@kohadevbox:koha$
Comment 2 Magnus Enger 2024-04-05 13:48:20 UTC
Created attachment 164477 [details] [review]
Bug 36517: Fix output from install_plugins.pl

When misc/devel/install_plugins.pl does not find any plugins, it prints
the list of pluginsdir, but with a literal \n separating the dirs, and
no newline at the end.

To test:
- Edit koha-conf.xml and add a second entry for <pluginsdir>, so there
  are two entries. The second one could just be a copy of the original.
- Run "perl misc/devel/install_plugins.pl"
- Note the output looks something like this:

No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins\n/var/lib/koha/kohadev/pluginsroot@kohadevbox:koha(master)$

- Apply the patch and run the script again. Output should be:

No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins
/var/lib/koha/kohadev/plugins
root@kohadevbox:koha(master)$

- Sign off
Comment 3 David Nind 2024-04-08 06:54:53 UTC
Created attachment 164493 [details] [review]
Bug 36517: Fix output from install_plugins.pl

When misc/devel/install_plugins.pl does not find any plugins, it prints
the list of pluginsdir, but with a literal \n separating the dirs, and
no newline at the end.

To test:
- Edit koha-conf.xml and add a second entry for <pluginsdir>, so there
  are two entries. The second one could just be a copy of the original.
- Run "perl misc/devel/install_plugins.pl"
- Note the output looks something like this:

No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins\n/var/lib/koha/kohadev/pluginsroot@kohadevbox:koha(master)$

- Apply the patch and run the script again. Output should be:

No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins
/var/lib/koha/kohadev/plugins
root@kohadevbox:koha(master)$

- Sign off

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Emily Lamancusa (emlam) 2024-04-10 13:20:28 UTC
Created attachment 164626 [details] [review]
Bug 36517: Fix output from install_plugins.pl

When misc/devel/install_plugins.pl does not find any plugins, it prints
the list of pluginsdir, but with a literal \n separating the dirs, and
no newline at the end.

To test:
- Edit koha-conf.xml and add a second entry for <pluginsdir>, so there
  are two entries. The second one could just be a copy of the original.
- Run "perl misc/devel/install_plugins.pl"
- Note the output looks something like this:

No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins\n/var/lib/koha/kohadev/pluginsroot@kohadevbox:koha(master)$

- Apply the patch and run the script again. Output should be:

No plugins found
pluginsdir contains:
/var/lib/koha/kohadev/plugins
/var/lib/koha/kohadev/plugins
root@kohadevbox:koha(master)$

- Sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 5 Emily Lamancusa (emlam) 2024-04-10 13:22:44 UTC
Good catch - thanks, Mangus! Passing QA
Comment 6 Katrin Fischer 2024-04-12 09:28:26 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 7 Fridolin Somers 2024-05-23 12:37:12 UTC
Pushed to 23.11.x for 23.11.06
Comment 8 Lucas Gass (lukeg) 2024-05-28 17:57:46 UTC
Backported to 23.05.x for upcoming 23.05.12