Bug 36517 - Fix output from install_plugins.pl
Summary: Fix output from install_plugins.pl
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Magnus Enger
QA Contact: Emily Lamancusa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-04 09:23 UTC by Magnus Enger
Modified: 2024-05-28 17:57 UTC (History)
5 users (show)

See Also:
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


Attachments
Bug 36517: Fix output from install_plugins.pl (1.60 KB, patch)
2024-04-05 13:48 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 36517: Fix output from install_plugins.pl (1.65 KB, patch)
2024-04-08 06:54 UTC, David Nind
Details | Diff | Splinter Review
Bug 36517: Fix output from install_plugins.pl (1.73 KB, patch)
2024-04-10 13:20 UTC, Emily Lamancusa
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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 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 2024-05-28 17:57:46 UTC
Backported to 23.05.x for upcoming 23.05.12