Bugzilla – Attachment 43630 Details for
Bug 14674
koha-create should set upload_path in koha-conf.xml
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14674: koha-create should populate upload_path
Bug-14674-koha-create-should-populate-uploadpath.patch (text/plain), 6.66 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-10-20 14:41:13 UTC
(
hide
)
Description:
Bug 14674: koha-create should populate upload_path
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-10-20 14:41:13 UTC
Size:
6.66 KB
patch
obsolete
>From 3f15a1067487425efc27e2c3c5a4b813e5cb3f13 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 20 Oct 2015 11:34:49 -0300 >Subject: [PATCH] Bug 14674: koha-create should populate upload_path > >This patch makes koha-create and koha-create-dirs aware of the new upload_path >configuration entry. > >It defaults to /var/lib/koha/<instance>/uploads as proposed by Robin but lets the >user specify its own directory, using the --upload-path option switch that is >added by this patch. > >koha-create-dirs is tweaked so it also creates this new directory. > >The docs are updated accordingly. > >To test: >- Apply the patch, have a packages setup (either by grabbing the relevant files [1] > or by creating your own package). >- Run koha-create --create-db instance >=> SUCCESS: /var/lib/koha/instance/uploads directory is created >=> SUCCESS: /etc/koha/sites/instance/koha-config.xml has upload_path set correctly >- Create a new instance using the --upload-path making it point to whatever you want >=> SUCCESS: koha-conf.xml points to your chosen path >- Sign off :-D > >Regards > >Sponsored-by: Universidad Nacional de Cordoba >--- > debian/docs/koha-create.xml | 9 +++++++++ > debian/scripts/koha-create | 25 ++++++++++++++++++++++++- > debian/scripts/koha-create-dirs | 1 + > debian/templates/koha-conf-site.xml.in | 2 +- > 4 files changed, 35 insertions(+), 2 deletions(-) > >diff --git a/debian/docs/koha-create.xml b/debian/docs/koha-create.xml >index 4ae1b7c..129de9d 100644 >--- a/debian/docs/koha-create.xml >+++ b/debian/docs/koha-create.xml >@@ -39,6 +39,7 @@ > <arg><option>--adminuser</option> n</arg> > <arg><option>--enable-sru</option></arg> > <arg><option>--sru-port</option> port</arg> >+ <arg><option>--upload-path</option> directory</arg> > <arg><option>--help</option>|<option>-h</option></arg> > > <arg choice="req" rep="norepeat"><replaceable>instancename</replaceable></arg> >@@ -168,6 +169,14 @@ > </varlistentry> > > <varlistentry> >+ <term><option>--upload-path</option></term> >+ <listitem> >+ <para>Specifiy a <option>directory</option> for storing the instance's uploaded files. >+ It defaults to <filename>/var/lib/koha/instance/uploads</filename>.</para> >+ </listitem> >+ </varlistentry> >+ >+ <varlistentry> > <term><option>--help</option>,<option>-h</option></term> > <listitem> > <para>Print usage information.</para> >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index 375707c..71c2175 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -69,6 +69,8 @@ Options: > --database dbname Enforce the use of the specified DB name (64 char limit) > --adminuser n Explicit the admin user ID in the DB. Relevant in > conjunction with --defaultsql and --populate-db. >+ --upload-path dir Set a user defined upload_path. It defaults to >+ /var/lib/koha/<instance>/uploads > --help,-h Show this help. > > Note: the instance name cannot be longer that 11 chars. >@@ -107,6 +109,7 @@ generate_config_file() { > -e "s/__DB_PASS__/$mysqlpwd/g" \ > -e "s/__UNIXUSER__/$username/g" \ > -e "s/__UNIXGROUP__/$username/g" \ >+ -e "s/__UPLOAD_PATH__/$UPLOAD_PATH/g" \ > -e "s/__PLUGINS_DIR__/\/var\/lib\/koha\/$name\/plugins/g" \ > -e "s/__MEMCACHED_NAMESPACE__/$MEMCACHED_NAMESPACE/g" \ > -e "s/__MEMCACHED_SERVERS__/$MEMCACHED_SERVERS/g" \ >@@ -286,6 +289,17 @@ set_memcached() > > } > >+set_upload_path() >+{ >+ local $instance="$1" >+ >+ if [ "$CLO_UPLOAD_PATH" != "" ]; then >+ UPLOAD_PATH=$CLO_UPLOAD_PATH >+ else >+ UPLOAD_PATH="$UPLOAD_PATH_BASE/$instance/$UPLOAD_DIR" >+ fi >+} >+ > enable_sru_server() > { > # remove the commenting symbols >@@ -318,6 +332,10 @@ MEMCACHED_PREFIX="" > # hardcoded memcached defaults > DEFAULT_MEMCACHED_SERVERS="127.0.0.1:11211" > DEFAULT_MEMCACHED_PREFIX="koha_" >+# hardcoded upload_path >+UPLOAD_PATH_BASE="/var/lib/koha" >+UPLOAD_DIR="uploads" >+UPLOAD_PATH="" > > # SRU server variables > ENABLE_SRU="no" >@@ -343,7 +361,7 @@ fi > > [ $# -ge 1 ] && [ $# -le 16 ] || ( usage ; die "Error: wrong parameters" ) > >-TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,use-memcached,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser:,memcached-servers:,memcached-prefix:, \ >+TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,use-memcached,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,database:,adminuser:,memcached-servers:,memcached-prefix:,upload-path:, \ > -n "$0" -- "$@"` > > # Note the quotes around `$TEMP': they are essential! >@@ -358,6 +376,7 @@ CLO_BIBLIOS_INDEXING_MODE="" > CLO_AUTHORITIES_INDEXING_MODE="" > CLO_MEMCACHED_SERVERS="" > CLO_MEMCACHED_PREFIX="" >+CLO_UPLOAD_PATH="" > > > while true ; do >@@ -398,6 +417,8 @@ while true ; do > ENABLE_SRU="yes" ; shift ;; > --sru-port) > SRU_SERVER_PORT="$2" ; shift 2 ;; >+ --upload-path) >+ CLO_UPLOAD_PATH="$2" ; shift 2 ;; > -h|--help) > usage ; exit 0 ;; > --) >@@ -458,6 +479,8 @@ set_authorities_indexing_mode $AUTHORITIES_INDEXING_MODE $ZEBRA_MARC_FORMAT > > name="$1" > >+set_upload_path $name >+ > if [ "$USE_MEMCACHED" = "yes" ]; then > set_memcached $name > elif [ "$CLO_MEMCACHED_SERVERS" != "" ] || \ >diff --git a/debian/scripts/koha-create-dirs b/debian/scripts/koha-create-dirs >index 52e2134..dae0d48 100755 >--- a/debian/scripts/koha-create-dirs >+++ b/debian/scripts/koha-create-dirs >@@ -52,6 +52,7 @@ do > userdir "$name" "/var/lib/koha/$name/biblios/shadow" > userdir "$name" "/var/lib/koha/$name/biblios/tmp" > userdir "$name" "/var/lib/koha/$name/plugins" >+ userdir "$name" "/var/lib/koha/$name/uploads" > userdir "$name" "/var/lock/koha/$name" > userdir "$name" "/var/lock/koha/$name/authorities" > userdir "$name" "/var/lock/koha/$name/biblios" >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index d5ed5aa..904a7e4 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -260,7 +260,7 @@ __END_SRU_PUBLICSERVER__ > <authorityservershadow>1</authorityservershadow> > <pluginsdir>__PLUGINS_DIR__</pluginsdir> > <enable_plugins>0</enable_plugins> >- <upload_path></upload_path> >+ <upload_path>__UPLOAD_PATH__</upload_path> > <intranetdir>/usr/share/koha/intranet/cgi-bin</intranetdir> > <opacdir>/usr/share/koha/opac/cgi-bin/opac</opacdir> > <opachtdocs>/usr/share/koha/opac/htdocs/opac-tmpl</opachtdocs> >-- >2.6.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14674
:
43630
|
43802
|
43803
|
43818
|
43819