Bugzilla – Attachment 74823 Details for
Bug 20525
Add --timezone switch to koha-create
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20525: Add --timezone switch to koha-create
Bug-20525-Add---timezone-switch-to-koha-create.patch (text/plain), 5.61 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-04-24 18:53:33 UTC
(
hide
)
Description:
Bug 20525: Add --timezone switch to koha-create
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-04-24 18:53:33 UTC
Size:
5.61 KB
patch
obsolete
>From 3d9b77ae7eef86f49413fcaa2a2049e7638a0b61 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 5 Apr 2018 11:07:30 -0300 >Subject: [PATCH] Bug 20525: Add --timezone switch to koha-create > >This patch adds a --timezone switch to koha-create so the timezone can >be set on creation time. It defaults to empty (i.e. using the server's >local time). > >To test: >- Create an instance: > $ sudo koha-create --create-db timezone1 >=> SUCCESS: /etc/koha/sites/timezone1/koha-conf.xml contains an empty ><timezone> entry. >- Apply this patch >- Run: > $ perl misc4dev/cp_debian_files.pl >- Create a new instance: > $ sudo koha-create --create-db timezone2 >=> SUCCESS: /etc/koha/sites/timezone2/koha-conf.xml contains an empty ><timezone> entry (i.e. the current behaviour is preserved). >- Create a new instance: > $ sudo koha-create --create-db --timezone Your/Timezone timezone3 >=> SUCCESS: /etc/koha/sites/timezone3/koha-conf.xml contains > <timezone>Your/Timezone</timezone> (i.e. introduced behaviour works) >- Sign off :-D > >Sponsored-by: ByWater Solutions >--- > debian/docs/koha-create.xml | 8 ++++++++ > debian/scripts/koha-create | 13 ++++++++++++- > debian/templates/koha-conf-site.xml.in | 2 +- > 3 files changed, 21 insertions(+), 2 deletions(-) > >diff --git a/debian/docs/koha-create.xml b/debian/docs/koha-create.xml >index 632140d471..e1132b25c3 100644 >--- a/debian/docs/koha-create.xml >+++ b/debian/docs/koha-create.xml >@@ -41,6 +41,7 @@ > <arg><option>--enable-sru</option></arg> > <arg><option>--sru-port</option> port</arg> > <arg><option>--template-cache-dir</option> directory</arg> >+ <arg><option>--timezone</option> time/zone</arg> > <arg><option>--upload-path</option> directory</arg> > <arg><option>--letsencrypt</option></arg> > <arg><option>--help</option>|<option>-h</option></arg> >@@ -193,6 +194,13 @@ > </listitem> > </varlistentry> > >+ <varlistentry> >+ <term><option>--timezone</option></term> >+ <listitem> >+ <para>Specify a <option>timezone</option> for the created instance. e.g. America/Argentina</para> >+ </listitem> >+ </varlistentry> >+ > <varlistentry> > <term><option>--upload-path</option></term> > <listitem> >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index cdfa63d813..ffde66a1db 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -72,6 +72,7 @@ Options: > conjunction with --defaultsql and --populate-db. > --template-cache-dir Set a user defined template_cache_dir. It defaults to > /var/cache/koha/<instance>/templates >+ --timezone time/zone Specify a timezone. e.g. America/Argentina > --upload-path dir Set a user defined upload_path. It defaults to > /var/lib/koha/<instance>/uploads > --letsencrypt Set up a https-only site with letsencrypt certificates >@@ -116,6 +117,7 @@ generate_config_file() { > -e "s/__UNIXUSER__/$username/g" \ > -e "s/__UNIXGROUP__/$username/g" \ > -e "s#__TEMPLATE_CACHE_DIR__#$TEMPLATE_CACHE_DIR#g" \ >+ -e "s#__TIMEZONE__#$TIMEZONE#g" \ > -e "s#__UPLOAD_PATH__#$UPLOAD_PATH#g" \ > -e "s/__LOG_DIR__/\/var\/log\/koha\/$name/g" \ > -e "s/__PLUGINS_DIR__/\/var\/lib\/koha\/$name\/plugins/g" \ >@@ -414,6 +416,8 @@ DEFAULT_MEMCACHED_PREFIX="koha_" > UPLOAD_PATH_BASE="/var/lib/koha" > UPLOAD_DIR="uploads" > UPLOAD_PATH="" >+# timezone defaults to empty >+TIMEZONE="" > # cache base dir > CACHE_DIR_BASE="/var/cache/koha" > # Generate a randomizaed API secret >@@ -444,7 +448,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:,dbhost:,database:,adminuser:,memcached-servers:,memcached-prefix:,template-cache-dir:,upload-path:,letsencrypt, \ >+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:,dbhost:,database:,adminuser:,memcached-servers:,memcached-prefix:,template-cache-dir:,timezone:,upload-path:,letsencrypt, \ > -n "$0" -- "$@"` > > # Note the quotes around `$TEMP': they are essential! >@@ -462,6 +466,7 @@ CLO_MEMCACHED_PREFIX="" > CLO_UPLOAD_PATH="" > CLO_LETSENCRYPT="" > CLO_TEMPLATE_CACHE_DIR="" >+CLO_TIMEZONE="" > > while true ; do > case "$1" in >@@ -505,6 +510,8 @@ while true ; do > SRU_SERVER_PORT="$2" ; shift 2 ;; > --template-cache-dir) > CLO_TEMPLATE_CACHE_DIR="$2" ; shift 2 ;; >+ --timezone) >+ CLO_TIMEZONE="$2" ; shift 2 ;; > --upload-path) > CLO_UPLOAD_PATH="$2" ; shift 2 ;; > --letsencrypt) >@@ -551,6 +558,10 @@ then > PASSWDFILE="$CLO_PASSWDFILE" > fi > >+if [ "$CLO_TIMEZONE" != "" ]; then >+ TIMEZONE=$CLO_TIMEZONE >+fi >+ > if [ "$CLO_BIBLIOS_INDEXING_MODE" != "" ]; then > BIBLIOS_INDEXING_MODE=$CLO_BIBLIOS_INDEXING_MODE > fi >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index d6f515ffe0..b1f78c9191 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -359,7 +359,7 @@ __END_SRU_PUBLICSERVER__ > <!-- The timezone setting can let you force the timezone for this > instance to be something other then the local timezone of the > server. e.g. Antarctica/South_Pole --> >- <timezone></timezone> >+ <timezone>__TIMEZONE__</timezone> > > </config> > </yazgfs> >-- >2.17.0
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 20525
:
73698
|
74823
|
74827
|
75138
|
75141