Bug 18913: Allow symbolic link in /etc/koha/sites
authorPongtawat C <pongtawat@punsarn.asia>
Sun, 9 Jul 2017 16:34:17 +0000 (23:34 +0700)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 19 Feb 2018 19:41:00 +0000 (16:41 -0300)
commitb7219cf43c18f0690be84657b3cbc5dcd33ec6a4
tree21386745a239970c0b896a2b8cd90acd98cb3ed0
parente7d4c773be5cf1df275827270465f7f55b95ce02
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>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
debian/scripts/koha-functions.sh