From 7fdad00ce6e54f3ab7196c80c0d027ddbf19dfba Mon Sep 17 00:00:00 2001 From: David Dean Date: Fri, 24 Aug 2012 11:45:53 +1200 Subject: [PATCH] Bug 8310 : Patch to store all instances in /var/lib/koha - For use with the debian packages --- debian/scripts/koha-create | 4 +-- debian/scripts/koha-create-dirs | 65 +++++++++++++++++++++++++++------------ debian/scripts/koha-list | 2 +- 3 files changed, 49 insertions(+), 22 deletions(-) diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index bb2b642..6fa21a7 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -244,8 +244,8 @@ eof # Generate and install Apache site-available file and log dir. generate_config_file apache-site.conf.in \ "/etc/apache2/sites-available/$name" - mkdir "/var/log/koha/$name" - chown "$username:$username" "/var/log/koha/$name" +# mkdir "/var/log/koha/$name" +# chown "$username:$username" "/var/log/koha/$name" # Generate and install main Koha config file. diff --git a/debian/scripts/koha-create-dirs b/debian/scripts/koha-create-dirs index 06b7bff..8ce9b22 100755 --- a/debian/scripts/koha-create-dirs +++ b/debian/scripts/koha-create-dirs @@ -36,26 +36,53 @@ rootdir() { fi } +createlink() { + local source="$1" + local dest="$2" + + if [ ! -L $dest ] && [ ! -d $dest ] + then + ln -s "$source" "$dest" + fi +} + for name in "$@" do - rootdir "/var/spool/koha/$name" - userdir "$name" "/etc/koha/sites/$name" - userdir "$name" "/var/lib/koha/$name" - userdir "$name" "/var/lib/koha/$name/authorities" - userdir "$name" "/var/lib/koha/$name/authorities/key" - userdir "$name" "/var/lib/koha/$name/authorities/register" - userdir "$name" "/var/lib/koha/$name/authorities/shadow" - userdir "$name" "/var/lib/koha/$name/authorities/tmp" - userdir "$name" "/var/lib/koha/$name/biblios" - userdir "$name" "/var/lib/koha/$name/biblios/key" - userdir "$name" "/var/lib/koha/$name/biblios/register" - userdir "$name" "/var/lib/koha/$name/biblios/shadow" - userdir "$name" "/var/lib/koha/$name/biblios/tmp" - userdir "$name" "/var/lock/koha/$name" - userdir "$name" "/var/lock/koha/$name/authorities" - userdir "$name" "/var/lock/koha/$name/biblios" - userdir "$name" "/var/run/koha/$name" - userdir "$name" "/var/run/koha/$name/authorities" - userdir "$name" "/var/run/koha/$name/biblios" + + KOHA_ROOT="/var/lib/koha/$name" + userdir "$name" "$KOHA_ROOT" + userdir "$name" "$KOHA_ROOT/var/lib/authorities" + userdir "$name" "$KOHA_ROOT/var/lib/authorities/key" + userdir "$name" "$KOHA_ROOT/var/lib/authorities/register" + userdir "$name" "$KOHA_ROOT/var/lib/authorities/shadow" + userdir "$name" "$KOHA_ROOT/var/lib/authorities/tmp" + userdir "$name" "$KOHA_ROOT/var/lib/biblios" + userdir "$name" "$KOHA_ROOT/var/lib/biblios/key" + userdir "$name" "$KOHA_ROOT/var/lib/biblios/register" + userdir "$name" "$KOHA_ROOT/var/lib/biblios/shadow" + userdir "$name" "$KOHA_ROOT/var/lib/biblios/tmp" + userdir "$name" "$KOHA_ROOT/var/lock" + userdir "$name" "$KOHA_ROOT/var/lock/authorities" + userdir "$name" "$KOHA_ROOT/var/lock/biblios" + userdir "$name" "$KOHA_ROOT/var/log" + userdir "$name" "$KOHA_ROOT/var/run" + userdir "$name" "$KOHA_ROOT/var/run/authorities" + userdir "$name" "$KOHA_ROOT/var/run/biblios" + rootdir "$KOHA_ROOT/var/spool" + userdir "$name" "$KOHA_ROOT/etc" + + rootdir "/var/lock/koha" + rootdir "/var/log/koha" + rootdir "/var/run/koha" + rootdir "/var/spool/koha" + + createlink "$KOHA_ROOT/var/spool" "/var/spool/koha/$name" + createlink "$KOHA_ROOT/etc" "/etc/koha/sites/$name" + createlink "$KOHA_ROOT/var/lib/authorities" "/var/lib/koha/$name/authorities" + createlink "$KOHA_ROOT/var/lib/biblios" "/var/lib/koha/$name/biblios" + createlink "$KOHA_ROOT/var/lock" "/var/lock/koha/$name" + createlink "$KOHA_ROOT/var/log" "/var/log/koha/$name" + createlink "$KOHA_ROOT/var/run" "/var/run/koha/$name" + done diff --git a/debian/scripts/koha-list b/debian/scripts/koha-list index 1e19f1a..edc2db2 100755 --- a/debian/scripts/koha-list +++ b/debian/scripts/koha-list @@ -63,7 +63,7 @@ do shift done -find /etc/koha/sites -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | +find -L /etc/koha/sites -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | sort | while read name do -- 1.7.9.5