Bug 18502 - koha-shell broken on dev installs
Summary: koha-shell broken on dev installs
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Testopia
URL:
Keywords:
Depends on: 16749
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-27 14:35 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2017-12-07 22:20 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 18502: Make koha-shell set the right PERL5LIB on dev installs (2.00 KB, patch)
2017-04-27 14:46 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 18502: Make koha-shell set the right PERL5LIB on dev installs (2.00 KB, patch)
2017-04-27 17:16 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 18502: Make koha-shell set the right PERL5LIB on dev installs (2.10 KB, patch)
2017-05-01 10:14 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18502: Make koha-shell set the right PERL5LIB on dev installs (2.12 KB, patch)
2017-05-02 14:06 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2017-04-27 14:35:39 UTC
Bug 16749 introduced a nice way to have flexible paths. During the discussion on how to do it, we moved from having it contain the path to the git dir to just a boolean. The 'koha-shell' script didn't get attention it seems, and it is broken on dev installs.

This was hidden by the fact that many of us run dev installs on kohadevbox, which sets a .bashrc file for de instance's user, containing the right path when opening the new shell.

To reproduce:
- On kohadevbox, run:
  $ sudo koha-shell kohadev -c "perl misc4dev/populate_db.pl"
=> FAIL: C4/Installer.pm not found on PERL5LIB error.

Fix to be attached.
Comment 1 Tomás Cohen Arazi (tcohen) 2017-04-27 14:46:01 UTC
Created attachment 62790 [details] [review]
Bug 18502: Make koha-shell set the right PERL5LIB on dev installs

Bug 16749 introduced a nice way to have flexible paths. During the discussion on how to do it, we moved from having it contain the path to the git dir to just a boolean. The 'koha-shell' script didn't get attention it seems, and it is broken on dev installs.

This was hidden by the fact that many of us run dev installs on kohadevbox, which sets a .bashrc file for de instance's user, containing the right path when opening the new shell.

This patch changes the logic so on a dev install, intranetdir is picked as the right path. This is how it is handled in koha-functions.sh

To test:
- On kohadevbox, run:
  $ sudo koha-shell kohadev -c "perl misc4dev/populate_db.pl"
=> FAIL: C4/Installer.pm not found on PERL5LIB error.
- Apply this patch
- Replace /usr/bin/koha-shell with debian/scripts/koha-shell
  $ sudo cp kohaclone/debian/scripts/koha-shell /usr/bin/koha-shell
- Run:
  $ sudo koha-shell kohadev -c "perl misc4dev/populate_db.pl"
=> SUCCESS: No warning about missing libs is raised.
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi (tcohen) 2017-04-27 17:16:30 UTC
Created attachment 62792 [details] [review]
Bug 18502: Make koha-shell set the right PERL5LIB on dev installs

Bug 16749 introduced a nice way to have flexible paths. During the discussion on how to do it, we moved from having it contain the path to the git dir to just a boolean. The 'koha-shell' script didn't get attention it seems, and it is broken on dev installs.

This was hidden by the fact that many of us run dev installs on kohadevbox, which sets a .bashrc file for de instance's user, containing the right path when opening the new shell.

This patch changes the logic so on a dev install, intranetdir is picked as the right path. This is how it is handled in koha-functions.sh

To test:
- On kohadevbox, run:
  $ sudo koha-shell kohadev -c "perl misc4dev/populate_db.pl"
=> FAIL: C4/Installer.pm not found on PERL5LIB error.
- Apply this patch
- Replace /usr/bin/koha-shell with debian/scripts/koha-shell
  $ sudo cp kohaclone/debian/scripts/koha-shell /usr/bin/koha-shell
- Run:
  $ sudo koha-shell kohadev -c "perl misc4dev/populate_db.pl"
=> SUCCESS: No warning about missing libs is raised.
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Marcel de Rooy 2017-05-01 10:14:54 UTC
Created attachment 62907 [details] [review]
Bug 18502: Make koha-shell set the right PERL5LIB on dev installs

Bug 16749 introduced a nice way to have flexible paths. During the discussion on how to do it, we moved from having it contain the path to the git dir to just a boolean. The 'koha-shell' script didn't get attention it seems, and it is broken on dev installs.

This was hidden by the fact that many of us run dev installs on kohadevbox, which sets a .bashrc file for de instance's user, containing the right path when opening the new shell.

This patch changes the logic so on a dev install, intranetdir is picked as the right path. This is how it is handled in koha-functions.sh

To test:
- On kohadevbox, run:
  $ sudo koha-shell kohadev -c "perl misc4dev/populate_db.pl"
=> FAIL: C4/Installer.pm not found on PERL5LIB error.
- Apply this patch
- Replace /usr/bin/koha-shell with debian/scripts/koha-shell
  $ sudo cp kohaclone/debian/scripts/koha-shell /usr/bin/koha-shell
- Run:
  $ sudo koha-shell kohadev -c "perl misc4dev/populate_db.pl"
=> SUCCESS: No warning about missing libs is raised.
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Nick Clemens (kidclamp) 2017-05-02 14:06:32 UTC
Created attachment 62957 [details] [review]
Bug 18502: Make koha-shell set the right PERL5LIB on dev installs

Bug 16749 introduced a nice way to have flexible paths. During the discussion on how to do it, we moved from having it contain the path to the git dir to just a boolean. The 'koha-shell' script didn't get attention it seems, and it is broken on dev installs.

This was hidden by the fact that many of us run dev installs on kohadevbox, which sets a .bashrc file for de instance's user, containing the right path when opening the new shell.

This patch changes the logic so on a dev install, intranetdir is picked as the right path. This is how it is handled in koha-functions.sh

To test:
- On kohadevbox, run:
  $ sudo koha-shell kohadev -c "perl misc4dev/populate_db.pl"
=> FAIL: C4/Installer.pm not found on PERL5LIB error.
- Apply this patch
- Replace /usr/bin/koha-shell with debian/scripts/koha-shell
  $ sudo cp kohaclone/debian/scripts/koha-shell /usr/bin/koha-shell
- Run:
  $ sudo koha-shell kohadev -c "perl misc4dev/populate_db.pl"
=> SUCCESS: No warning about missing libs is raised.
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Jonathan Druart 2017-05-05 15:15:23 UTC
Pushed to master for 17.05, thanks!

For GBSD we want kohadevboxes to be populated automatically.
Comment 6 Katrin Fischer 2017-05-13 12:37:08 UTC
Missing piece for including bug 16733 - will come back to this later.
Comment 7 Katrin Fischer 2017-05-16 06:00:02 UTC
This patch has been pushed to 16.11.x and will be in 16.11.08.
Comment 8 Mason James 2017-05-24 03:06:56 UTC
Blocked by Enhancement, skipping for 16.05.x