View | Details | Raw Unified | Return to bug 13971
Collapse All | Expand All

(-)a/debian/scripts/koha-functions.sh (+25 lines)
Lines 126-128 get_instances() Link Here
126
    find /etc/koha/sites -mindepth 1 -maxdepth 1\
126
    find /etc/koha/sites -mindepth 1 -maxdepth 1\
127
                         -type d -printf '%f\n' | sort
127
                         -type d -printf '%f\n' | sort
128
}
128
}
129
130
get_perl5lib()
131
{
132
    local instancename=$1
133
134
    #first try perl5lib in koha-conf.xml
135
    local retval=$(xmlstarlet sel -t -v 'yazgfs/config/perl5lib' /etc/koha/sites/$instancename/koha-conf.xml)
136
137
    if [ "$retval" != "" ]; then
138
        echo "$retval"
139
    else
140
        echo "/usr/share/koha/lib"
141
    fi
142
}
143
144
is_gitified()
145
{
146
    local instancename=$1
147
    local retval=$(xmlstarlet sel -t -v 'yazgfs/config/gitified' /etc/koha/sites/$instancename/koha-conf.xml)
148
    if [ "$retval" = "1" ]; then
149
        return 0
150
    else
151
        return 1
152
    fi
153
}
(-)a/debian/scripts/koha-rebuild-zebra (-4 / +15 lines)
Lines 20-26 Link Here
20
set -e
20
set -e
21
21
22
# include helper functions
22
# include helper functions
23
if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then
23
scriptdir=$(dirname "$0")
24
if [ -f $scriptdir/koha-functions.sh ]; then
25
    . "$scriptdir/koha-functions.sh"
26
elif [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then
24
    . "/usr/share/koha/bin/koha-functions.sh"
27
    . "/usr/share/koha/bin/koha-functions.sh"
25
else
28
else
26
    echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2
29
    echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2
Lines 49-60 run_rebuild_zebra() Link Here
49
{
52
{
50
    local instancename=$1; shift
53
    local instancename=$1; shift
51
54
55
    # If we 'gitified' a Koha instance, point to adjusted locations
56
    local libpath=$(get_perl5lib $instancename)
57
    local rebuild
58
    if is_gitified $instancename; then
59
        rebuild="$libpath/misc"
60
    else
61
        rebuild="/usr/share/koha/bin"
62
    fi
63
52
    # TODO: This comment is here to remind us that we should make
64
    # TODO: This comment is here to remind us that we should make
53
    # rebuild_zebra.pl return error codes on failure
65
    # rebuild_zebra.pl return error codes on failure
54
    if sudo -u "$instancename-koha" -H \
66
    if sudo -u "$instancename-koha" -H \
55
        env PERL5LIB=/usr/share/koha/lib \
67
        env PERL5LIB=$libpath \
56
        KOHA_CONF="/etc/koha/sites/$instancename/koha-conf.xml" \
68
        KOHA_CONF="/etc/koha/sites/$instancename/koha-conf.xml" \
57
        /usr/share/koha/bin/migration_tools/rebuild_zebra.pl $@ ; then
69
        $rebuild/migration_tools/rebuild_zebra.pl $@ ; then
58
        return 0
70
        return 0
59
    else
71
    else
60
        return 1
72
        return 1
61
- 

Return to bug 13971