koha-upgrade-schema seems to currently not work with git/dev koha-gitify installs this patch attempts to fix this issue
here's an example of a failed attempt... # koha-create --create-db master # koha-gitify master /path/to/my/koha # apachectl restart # koha-upgrade-schema -v master Upgrading database schema for -v unable to locate Koha configuration file koha-conf.xml at /usr/share/koha/lib/C4/Context.pm line 373. unable to locate Koha configuration file koha-conf.xml at /usr/share/koha/lib/C4/Context.pm line 373. unable to locate Koha configuration file koha-conf.xml at /usr/share/koha/lib/C4/Context.pm line 373. Can't call method "config" on unblessed reference at /usr/share/koha/lib/C4/Context.pm line 796.
> # koha-upgrade-schema -v master > Upgrading database schema for -v oops, typo ^ root@xen1:~# sh -x /usr/sbin/koha-upgrade-schema master + set -e + update=/usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl + echo Upgrading database schema for master Upgrading database schema for master + KOHA_CONF=/etc/koha/sites/master/koha-conf.xml PERL5LIB=/usr/share/koha/lib /usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl this is a similar issue to 13216, where PERL5LIB is assumed be '/usr/share/koha'
I'd like to say that gitified instance issues should be handled outside Koha... With that in mind, I'd say the best approach to this is to make the scripts (all of them?) - Test for PERL5LIB be defined (so we can make koha-gitify wrap things or... we'll solve it) - Otherwise fallback to the system-wide one that is set in /etc/default/koha-common So maintenance scripts should do something like this: # include helper functions if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then . "/usr/share/koha/bin/koha-functions.sh" else echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2 exit 1 fi Ok, most of them do it already. And then add to koha-functions.sh the check+read: if [ ! -z $PERL5LIB ]; then CLI_PERL5LIB=$PERL5LIB fi if [ -r /etc/default/$NAME ]; then # Debian / Ubuntu . /etc/default/$NAME elif [ -r /etc/sysconfig/$NAME ]; then # RedHat / SuSE . /etc/sysconfig/$NAME fi if [ ! -z $CLI_PERL5LIB ]; then PERL5LIB=$CLI_PERL5LIB fi
(In reply to Tomás Cohen Arazi from comment #3) > I'd like to say that gitified instance issues should be handled outside > Koha... With that in mind, I'd say the best approach to this is to make the > scripts (all of them?) > - Test for PERL5LIB be defined (so we can make koha-gitify wrap things or... > we'll solve it) > - Otherwise fallback to the system-wide one that is set in > /etc/default/koha-common I submitted some patches on bug 16733 to adjust all debian scripts that use PERL5LIB (including this one). With some minimal changes and less hardcoded paths, we can make life easier for those of us willing to use debian scripts and having a dev install. My approach seems to be what Tomas suggested: read the defaults, add one line to koha-conf for dev installs, and adjust PERL5LIB if needed.