Bugzilla – Attachment 41574 Details for
Bug 13791
Plack - Out of the box support on packages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13791: make koha-list aware of plack
Bug-13791-make-koha-list-aware-of-plack.patch (text/plain), 5.75 KB, created by
Josef Moravec
on 2015-08-18 08:02:26 UTC
(
hide
)
Description:
Bug 13791: make koha-list aware of plack
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2015-08-18 08:02:26 UTC
Size:
5.75 KB
patch
obsolete
>From 89a3af02671fc5a5db9715da1387ead8bd69f9fb Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 13 Aug 2015 14:49:01 -0300 >Subject: [PATCH] Bug 13791: make koha-list aware of plack > >This patch adds the --plack and --noplack option switches to koha-list >for filtering instances to be listed. > >This is particularly important for init scripts and cronjobs. > >To test: >- Play with koha-list --plack and koha-plack --enable/--disable and verify that >koha-list returns the expected results. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > debian/scripts/koha-foreach | 5 ++++ > debian/scripts/koha-functions.sh | 4 +-- > debian/scripts/koha-list | 61 +++++++++++++++++++++++++++++++++------- > 3 files changed, 58 insertions(+), 12 deletions(-) > >diff --git a/debian/scripts/koha-foreach b/debian/scripts/koha-foreach >index 6e4d98d..925d90b 100755 >--- a/debian/scripts/koha-foreach >+++ b/debian/scripts/koha-foreach >@@ -25,6 +25,11 @@ do > --email) listopts="$listopts --email";; > --noemail) listopts="$listopts --noemail";; > --enabled) listopts="$listopts --enabled";; >+ --disabled) listopts="$listopts --disabled";; >+ --sip) listopts="$listopts --sip";; >+ --nosip) listopts="$listopts --nosip";; >+ --plack) listopts="$listopts --plack";; >+ --noplack) listopts="$listopts --noplack";; > *) break;; > esac > shift >diff --git a/debian/scripts/koha-functions.sh b/debian/scripts/koha-functions.sh >index 06ca274..34c6396 100755 >--- a/debian/scripts/koha-functions.sh >+++ b/debian/scripts/koha-functions.sh >@@ -134,9 +134,9 @@ is_plack_enabled() > "$instancefile" && \ > grep -q '^[[:space:]]*Include /etc/koha/apache-shared-intranet-plack.conf' \ > "$instancefile" ; then >- return 1 >- else > return 0 >+ else >+ return 1 > fi > } > >diff --git a/debian/scripts/koha-list b/debian/scripts/koha-list >index 848494b..73ce075 100755 >--- a/debian/scripts/koha-list >+++ b/debian/scripts/koha-list >@@ -37,20 +37,23 @@ show_instances() > case $show in > "all") > if instance_filter_email $instance $show_email && \ >- instance_filter_sip $instance $show_sip; then >+ instance_filter_plack $instance $show_plack && \ >+ instance_filter_sip $instance $show_sip; then > echo $instance > fi ;; > "enabled") > if is_enabled $instance; then > if instance_filter_email $instance $show_email && \ >- instance_filter_sip $instance $show_sip; then >+ instance_filter_plack $instance $show_plack && \ >+ instance_filter_sip $instance $show_sip; then > echo $instance > fi > fi ;; > "disabled") > if ! is_enabled $instance; then > if instance_filter_email $instance $show_email && \ >- instance_filter_sip $instance $show_sip; then >+ instance_filter_plack $instance $show_plack && \ >+ instance_filter_sip $instance $show_sip; then > echo $instance > fi > fi ;; >@@ -81,6 +84,28 @@ instance_filter_sip() > return 1 > } > >+instance_filter_plack() >+{ >+ local instancename=$1 >+ local show_plack=$2; >+ >+ case $show_plack in >+ "all") >+ return 0 ;; >+ "enabled") >+ if is_plack_enabled $instancename; then >+ return 0 >+ fi ;; >+ "disabled") >+ if ! is_plack_enabled $instancename; then >+ return 0 >+ fi ;; >+ esac >+ >+ # Didn't match any criteria >+ return 1 >+} >+ > instance_filter_email() > { > local instancename=$1 >@@ -125,6 +150,17 @@ set_show_email() > fi > } > >+set_show_plack() >+{ >+ local plack_param=$1 >+ >+ if [ "$show_plack" = "all" ]; then >+ show_plack=$plack_param >+ else >+ die "Error: --plack and --noplack are mutually exclusive." >+ fi >+} >+ > set_show_sip() > { > local sip_param=$1 >@@ -146,12 +182,14 @@ email turned on. > > Usage: $scriptname [--enabled|--disabled] [--email|--noemail] [--sip|--nosip] [-h] > Options: >- --enabled Only show instances that are enabled >- --disabled Only show instances that are disabled >- --email Only show instances that have email enabled >- --noemail Only show instances that do not have email enabled >- --sip Only show instances that have SIP enabled >- --nosip Only show instances that do not have SIP enabled >+ --enabled Show enabled instances >+ --disabled Show disabled instances >+ --email Show instances with email enabled >+ --noemail Show instances with email disabled >+ --sip Show instances with SIP enabled >+ --nosip Show instances with SIP disabled >+ --plack Show instances with Plack enabled >+ --noplack Show instances with Plack disabled > --help | -h Show this help > > The filtering options can be combined, and you probably want to do this >@@ -162,8 +200,9 @@ EOH > show="all" > show_email="all" > show_sip="all" >+show_plack="all" > >-args=$(getopt -l help,enabled,disabled,email,noemail,sip,nosip -o h -n $0 -- "$@") >+args=$(getopt -l help,enabled,disabled,email,noemail,sip,nosip,plack,noplack -o h -n $0 -- "$@") > set -- $args > > while [ ! -z "$1" ] >@@ -174,6 +213,8 @@ do > --noemail) set_show_email "disabled" ;; > --sip) set_show_sip "enabled" ;; > --nosip) set_show_sip "disabled" ;; >+ --plack) set_show_plack "enabled" ;; >+ --noplack) set_show_plack "disabled" ;; > --enabled) set_show "enabled" ;; > --disabled) set_show "disabled" ;; > *) break;; >-- >2.1.4
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 13791
:
41481
|
41482
|
41483
|
41484
|
41485
|
41486
|
41503
|
41504
|
41505
|
41506
|
41507
|
41508
|
41509
|
41510
|
41511
|
41512
|
41513
|
41563
|
41564
|
41565
|
41566
|
41567
|
41568
|
41571
|
41572
|
41573
|
41574
|
41575
|
41576
|
41748
|
41749
|
41750
|
41751
|
41752
|
41753
|
41866
|
42038