Bug 17951: Make koha-create set template_cache_dir correctly
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 24 Jan 2017 15:48:18 +0000 (12:48 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 22 Dec 2017 16:15:39 +0000 (13:15 -0300)
commit06a1f18a1b7c0b34d0519084d17fd52a7f32bec4
tree62ea1daacea3e88094d68c52909fe389406cf269
parent9a2767b577abd38bf63a2f815339eed3b93ecba7
Bug 17951: Make koha-create set template_cache_dir correctly

This patch makes koha-create (and friends) handle the template_cache_dir
config entry correctly.

It does so by:
- Adding a replaceable string to the template for koha-conf.xml
- Making koha-create-dirs create the needed directories (i.e.
 /var/cache/koha/instance and /var/cache/koha/instance/templates)
- Adding a --template-cache-dir switch to koha-create (so sysadmins can
  specify their favourite directory for the templates cache).
- koha-remove now takes care of the instance's *templates* dir.
- The install scripts now automatically create /var/cache/koha so it can
  be used later by koha-create and friends. It does so the same way it does
  for other install-created directories.

To test, you should ideally be able to build your own packages. This
instructions can be followed by people that doesn't have that ability
yet. But can be used on a custom packages setup too.

To test:
- Make sure you have the latest misc4dev in your kohadevbox (if it is a
  fresh box you have it already)
- Run:
  $ sudo perl misc4dev/cp_debian_files.pl
- Manually create the /var/cache/koha dir (skip if you have your own
        packages):
  $ sudo mkdir /var/cache/koha
- Create a new instance:
  $ sudo koha-create --create-db cachetest
=> SUCCESS:
    * /etc/koha/sites/cachetest/koha-conf.xml contains
    template_cache_dir and is populated with /var/cache/koha/cachetest/templates
    * The directory /var/cache/koha/cachetest/templates exists!
- Create a new instance, pass your own cache dir:
  $ sudo koha-create --create-db --template-cache-dir /tmp cachetest2
=> SUCCESS: etc/koha/sites/cachetest2/koha-conf.xml contains template_cache_dir
   and is populated with /tmp
- Run:
  $ man koha-create
=> SUCCESS: The docs mention the --template-cache-dir option switch
    correctly.
- Sign off :-D!

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
debian/docs/koha-create.xml
debian/koha-common.dirs
debian/scripts/koha-create
debian/scripts/koha-create-dirs
debian/scripts/koha-remove
debian/templates/koha-conf-site.xml.in