Summary: | Allow symbolic link in /etc/koha/sites | ||
---|---|---|---|
Product: | Koha | Reporter: | Pongtawat <pongtawat> |
Component: | Architecture, internals, and plumbing | Assignee: | Pongtawat <pongtawat> |
Status: | CLOSED FIXED | QA Contact: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | jonathan.druart, josef.moravec, mtompset, nick, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | Sponsored | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Allow symbolic link in /etc/koha/sites
Bug 18913 - Allows symbolic link in /etc/koha/sites Bug 18913: Allow symbolic link in /etc/koha/sites |
Description
Pongtawat
2017-07-09 16:33:19 UTC
Created attachment 64935 [details] [review] Allow symbolic link in /etc/koha/sites Test Plan: Before patch: 1) Create a Koha site called demo 2) mv /etc/koha/sites/demo /srv/demo 3) ln -s /srv/demo /etc/koha/sites/ 4) koha-list will not show demo as one of the site 5) koha-list --enabled will not show demo as one of the site After patch: 1) Create a Koha site called demo 2) mv /etc/koha/sites/demo /srv/demo 3) ln -s /srv/demo /etc/koha/sites/ 4) koha-list will show demo as one of the site 5) koha-list --enabled will show demo as one of the site Please don't forget to assign your bugs to yourself :) Had to adapt test plan, because you need to copy the script file into place. perl /home/vagrant/misc4dev/do_all_you_can_do.pl --instance test --userid admin --password admin But other than that, seems to work. -L basically says to follow symbolic links, so this doesn't break anything as far as I can tell. Created attachment 68511 [details] [review] Bug 18913 - Allows symbolic link in /etc/koha/sites Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Thanks for signing off. And sorry that I forgot that the script has to be copied to system location first. BTW, is there a way to test Debian script directly from the git (dev) layout? Should this be targetted for master? Created attachment 71939 [details] [review] Bug 18913: Allow symbolic link in /etc/koha/sites This patch makes the koha-* scripts follow symbolic links when querying for Koha instances. Without it, it is not possible to define instances outside the /etc/koha/sites directory, To test: - Create a symlink in /etc/koha/sites: $ sudo ln -s /tmp /etc/koha/sites/test - Test the original is_instance function: $ . /usr/share/koha/bin/koha-functions.sh $ is_instance test && echo success || echo failure => FAIL: symlinks are not considered instance names (i.e. failure is printed) - Apply this patch - Update the koha-functions.sh file: $ perl misc4dev/cp_debian_files.pl - Test is_instance again: $ . /usr/share/koha/bin/koha-functions.sh $ is_instance test && echo success || echo failure => SUCCESS: symlinks are considered instance names (i.e. success is printed) - Sign off :-D Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Patch pushed to master for 18.05 Congratulations Pongtawat for your first patch in! Enhancement, not backported for 17.11 |