Bugzilla – Attachment 4679 Details for
Bug 6540
Add more options to koha-create
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Followup - Add command line option for config file
0004-Bug-6540-Add-config-file-as-command-line-option-for-.patch (text/plain), 2.86 KB, created by
Magnus Enger
on 2011-07-20 17:13:16 UTC
(
hide
)
Description:
Followup - Add command line option for config file
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2011-07-20 17:13:16 UTC
Size:
2.86 KB
patch
obsolete
>From f85946a03293681d919ef67edaa5fb5407a49a57 Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@enger.priv.no> >Date: Wed, 20 Jul 2011 19:01:19 +0200 >Subject: [PATCH 4/4] Bug 6540 - Add config file as command line option for koha-create > >Order of precedence for config options, from lowest to highest: > >1. The defaults set in koha-create itself >2. /etc/koha/koha-sites.conf >3. Config file specified with --configfile >4. Individual options set with --marcflavor, --zebralang, --defaultsql >--- > debian/scripts/koha-create | 48 +++++++++++++++++++++++++++++++++++-------- > 1 files changed, 39 insertions(+), 9 deletions(-) > >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index 85b208b..5c742e1 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -19,6 +19,11 @@ > > set -e > >+usage="Usage: $0 [--create-db|--request-db|--populate-db] \ >+[--marcflavor marc21|normarc|unimarc] \ >+[--zebralang en|fr|nb] [--defaultsql /path/to/some.sql] >+[--configfile /path/to/config] instancename" >+ > die() { > echo "$@" 1>&2 > exit 1 >@@ -71,30 +76,55 @@ then > . /etc/koha/koha-sites.conf > fi > >-[ $# -ge 2 ] && [ $# -le 6 ] || >- die "Usage: $0 [--create-db|--request-db|--populate-db] \ >-[--marcflavor marc21|normarc|unimarc] \ >-[--zebralang en|fr|nb] instancename" >+[ $# -ge 2 ] && [ $# -le 10 ] || die $usage > >-TEMP=`getopt -o crpm:l: -l create-db,request-db,populate-db,marcflavor:,zebralang: \ >+TEMP=`getopt -o crpm:l: -l create-db,request-db,populate-db,marcflavor:,zebralang:,configfile: \ > -n "$0" -- "$@"` > > # Note the quotes around `$TEMP': they are essential! > eval set -- "$TEMP" > >+# Temporary variables for the command line options >+CLO_ZEBRA_MARC_FORMAT="" >+CLO_ZEBRA_LANGUAGE="" >+CLO_DEFAULTSQL="" >+ > while true ; do > case "$1" in > -c|--create-db) op=create ; shift ;; > -r|--request-db) op=request ; shift ;; > -p|--populate-db) op=populate ; shift ;; >- -m|--marcflavor) ZEBRA_MARC_FORMAT="$2" ; shift 2 ;; >- -l|--zebralang) ZEBRA_LANGUAGE="$2" ; shift 2 ;; >- -d|--defaultsql) DEFAULTSQL="$2" ; shift 2 ;; >+ -m|--marcflavor) CLO_ZEBRA_MARC_FORMAT="$2" ; shift 2 ;; >+ -l|--zebralang) CLO_ZEBRA_LANGUAGE="$2" ; shift 2 ;; >+ -d|--defaultsql) CLO_DEFAULTSQL="$2" ; shift 2 ;; >+ -f|--configfile) configfile="$2" ; shift 2 ;; > --) shift ; break ;; >- *) die "Internal error! " ;; >+ *) die $usage ;; > esac > done > >+# Load the configfile given on the command line >+if [ -e "$configfile" ] >+then >+ . "$configfile" >+else >+ die "$configfile does not exist."; >+fi >+ >+# Make sure options from the command line get the highest precedence >+if [ "$CLO_ZEBRA_MARC_FORMAT" != "" ] >+then >+ ZEBRA_MARC_FORMAT="$CLO_ZEBRA_MARC_FORMAT" >+fi >+if [ "$CLO_ZEBRA_LANGUAGE" != "" ] >+then >+ ZEBRA_LANGUAGE="$CLO_ZEBRA_LANGUAGE" >+fi >+if [ "$CLO_DEFAULTSQL" != "" ] >+then >+ DEFAULTSQL="$CLO_DEFAULTSQL" >+fi >+ > name="$1" > > domain="$name$DOMAIN" >-- >1.7.4.1 >
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 6540
:
4649
|
4660
|
4677
|
4679
|
4690
|
4691
|
4692
|
4693
|
4694
|
4696
|
5016
|
5100