Created attachment 52561 [details] [review] Bug 16749: Adjustments for koha-translate [1] Add a -d|--dev parameter for dev installs. [2] KOHA_CONF is not needed in this script. [3] No hardcoded PERL5LIB, following bug 16733. [4] Adjust template paths for dev installs: OPAC_TMPL, INTRANET_TMPL. [5] Remove reference now to obsolete thems ccsr and prog. Test plan: [1] Regular package install: Run koha-translate -l to show installed languages. Run koha-translate -l -a to show available languages. Add a language: koha-translate -i nl-NL. Check the nl-NL folder. Remove a language: koha-translate -r nl-NL. Check again. [2] If you have a dev install too, try: Add the <dev_install> line to koha-conf.xml. (See 16733.) Run koha-translate -l -d yourinstance to show installed languages. (Note: You only see the languages installed in that instance.) Add a language: koha-translate -i nl-NL -d yourinstance. Remove a language: koha-translate -r nl-NL -d yourinstance. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
*** Bug 13295 has been marked as a duplicate of this bug. ***
debian/docs/koha-translate.xml needs to be updated with the --dev option.
Created attachment 55490 [details] [review] Bug 16749: Update debian docs for koha-translate This patch adds the -d option to the documentation (with thanks to Magnus Enger).
% sudo koha-translate --dev kohadev --install es-ES % ls koha-tmpl/intranet-tmpl/prog|grep es-ES Does not return anything, what did I miss? I have used a very new script to update the debian files, cp_debian_files.pl on koha-misc4dev (see https://github.com/joubu/koha-misc4dev).
(In reply to Jonathan Druart from comment #5) > % sudo koha-translate --dev kohadev --install es-ES > % ls koha-tmpl/intranet-tmpl/prog|grep es-ES > > Does not return anything, what did I miss? Will have a look again. This was written six months ago without much attention ever since..
(In reply to Jonathan Druart from comment #5) > % sudo koha-translate --dev kohadev --install es-ES > % ls koha-tmpl/intranet-tmpl/prog|grep es-ES > > Does not return anything, what did I miss? > > I have used a very new script to update the debian files, cp_debian_files.pl > on koha-misc4dev (see https://github.com/joubu/koha-misc4dev). Dumb question, but you checked this? Add the <dev_install> line to koha-conf.xml. (See 16733.)
(In reply to Marcel de Rooy from comment #7) > (In reply to Jonathan Druart from comment #5) > > % sudo koha-translate --dev kohadev --install es-ES > > % ls koha-tmpl/intranet-tmpl/prog|grep es-ES > > > > Does not return anything, what did I miss? > > > > I have used a very new script to update the debian files, cp_debian_files.pl > > on koha-misc4dev (see https://github.com/joubu/koha-misc4dev). > > Dumb question, but you checked this? > Add the <dev_install> line to koha-conf.xml. (See 16733.) Nope :) Why don't you use intranetdir?
(In reply to Jonathan Druart from comment #8) > (In reply to Marcel de Rooy from comment #7) > > (In reply to Jonathan Druart from comment #5) > > > % sudo koha-translate --dev kohadev --install es-ES > > > % ls koha-tmpl/intranet-tmpl/prog|grep es-ES > > > > > > Does not return anything, what did I miss? > > > > > > I have used a very new script to update the debian files, cp_debian_files.pl > > > on koha-misc4dev (see https://github.com/joubu/koha-misc4dev). > > > > Dumb question, but you checked this? > > Add the <dev_install> line to koha-conf.xml. (See 16733.) > > Nope :) > Why don't you use intranetdir? dev_install tells you too that this is a gitified install
(In reply to Marcel de Rooy from comment #9) > (In reply to Jonathan Druart from comment #8) > > Why don't you use intranetdir? > > dev_install tells you too that this is a gitified install In that case, does a boolean flag would be enough? If dev_install will always be equal to intranetdir it would make more sense to have a flag. What do you think?
(In reply to Jonathan Druart from comment #10) > (In reply to Marcel de Rooy from comment #9) > > (In reply to Jonathan Druart from comment #8) > > > Why don't you use intranetdir? > > > > dev_install tells you too that this is a gitified install > > In that case, does a boolean flag would be enough? If dev_install will > always be equal to intranetdir it would make more sense to have a flag. What > do you think? That sounds reasonable ;)
test: obsoleted comment 2
(In reply to Marcel de Rooy from comment #12) > test: obsoleted comment 2 does not seem to work
Tomas, can we get your opinion on comment 10?
(In reply to Jonathan Druart from comment #10) > (In reply to Marcel de Rooy from comment #9) > > (In reply to Jonathan Druart from comment #8) > > > Why don't you use intranetdir? > > > > dev_install tells you too that this is a gitified install > > In that case, does a boolean flag would be enough? If dev_install will > always be equal to intranetdir it would make more sense to have a flag. What > do you think? I think we should go with a boolean flag. We love booleans.
Created attachment 60064 [details] [review] Bug 17049: Improve PERL5LIB handling for packaged dev install This is a small follow-up for report 16733. If you would have multiple paths in PERL5LIB from /etc/defaults, adjust_paths_dev_install would agressively replace them for dev installs. This patch makes it remove usr/share/koha/lib only and add the new dev install path. Test plan: [1] Apply the patches for 16733 and 17049. [2] Add a <dev_install>/just/a/path</dev_install> to koha-conf.xml. [3] Source the adjusted koha-functions.sh within your master clone: . debian/scripts/koha-functions.sh [4] Enter unset PERL5LIB; adjust_paths_dev_install [your-clone] [5] Check the result with echo $PERL5LIB. Should be /just/a/path. [6] Try PERL5LIB=/usr/share/koha/lib Run adjust_paths_dev_install [your-clone] Check the result with echo $PERL5LIB. Should be /just/a/path. [7] Similarly, try /a:/usr/share/koha/lib Expect: /just/a/path:/a And /a:/usr/share/koha/lib:/b. Expect: /just/a/path:/a:/b
Moving a patch from 17049 here. Im having an issue on kohadevbox with the xmlstarlet subshell in the bash function adjust_paths.. If the key is not found, it fails silently. While it normally should not. Will be contacting Tomas about this soon.
Created attachment 60103 [details] [review] Bug 16749: Adjust xmlstarlet calls in koha-functions WORK_IN_PROGRESS
Created attachment 60106 [details] [review] Bug 16749: Adjustments for koha-plack [1] Use run_safe_xmlstarlet for plack workers and requests [2] Simplify adjust_paths
Comment on attachment 60064 [details] [review] Bug 17049: Improve PERL5LIB handling for packaged dev install Obsoleting this theoretical approach
Created attachment 60109 [details] [review] Bug 16749: Adjust xmlstarlet calls in koha-functions In various scripts we use xmlstarlet to extract values from koha-conf. If we call xmlstarlet on non-existing entries in koha-conf, this may however result in silently failing scripts. A function run_safe_xmlstarlet is added for situations where the entry might not be there. No need to use it everywhere rightaway. This patch only adjusts koha-functions and modifies the xmlstarlet calls for dev_install and zebra_loglevels. Test plan: [1] Apply the patch for koha-plack too. [2] Copy koha-functions.sh and koha-plack from clone to default locations. [3] Start and stop koha-plack while you have dev_install in koha-conf. Verify with ps aux|grep plack. [4] Rename dev_install to nodev_install and start/stop koha-plack. Verify with ps aux|grep plack. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested on a Debian VM and with a Windows kohadevbox :)
Created attachment 60110 [details] [review] Bug 16749: Adjustments for koha-plack [1] Use run_safe_xmlstarlet for plack workers and requests [2] Simplify adjust_paths. The lazy export statement is actually enough to replace adjust_paths by one direct call to adjust_paths_dev_install. Test plan: [1] See patch for adjusting xmlstarlet calls. [2] Change plack_requests to 51 in your koha-conf. Restart Plack and check that you see 51 in ps aux|grep plack. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 60111 [details] [review] Bug 16749: Adjust xmlstarlet calls in koha-functions In various scripts we use xmlstarlet to extract values from koha-conf. If we call xmlstarlet on non-existing entries in koha-conf, this may however result in silently failing scripts. A function run_safe_xmlstarlet is added for situations where the entry might not be there. No need to use it everywhere rightaway. This patch only adjusts koha-functions and modifies the xmlstarlet calls for dev_install and zebra_loglevels. Test plan: [1] Apply the patch for koha-plack too. [2] Copy koha-functions.sh and koha-plack from clone to default locations. [3] Start and stop koha-plack while you have dev_install in koha-conf. Verify with ps aux|grep plack. [4] Rename dev_install to nodev_install and start/stop koha-plack. Verify with ps aux|grep plack. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested on a Debian VM and with a Windows kohadevbox :)
Created attachment 60112 [details] [review] Bug 16749: Adjustments for koha-plack [1] Use run_safe_xmlstarlet for plack workers and requests [2] Simplify adjust_paths. The lazy export statement is actually enough to replace adjust_paths by one direct call to adjust_paths_dev_install. Test plan: [1] See patch for adjusting xmlstarlet calls. [2] Change plack_requests to 51 in your koha-conf. Restart Plack and check that you see 51 in ps aux|grep plack. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 60113 [details] [review] Bug 16749: Adjustments for koha-translate [1] Add a -d|--dev parameter for dev installs. [2] KOHA_CONF is not needed in this script. [3] No hardcoded PERL5LIB, following bug 16733. [4] Adjust template paths for dev installs: OPAC_TMPL, INTRANET_TMPL. [5] Remove reference now to obsolete thems ccsr and prog. Test plan: [1] Regular package install: Run koha-translate -l to show installed languages. Run koha-translate -l -a to show available languages. Add a language: koha-translate -i nl-NL. Check the nl-NL folder. Remove a language: koha-translate -r nl-NL. Check again. [2] If you have a dev install too, try: Add the <dev_install> line to koha-conf.xml. (See 16733.) Run koha-translate -l -d yourinstance to show installed languages. (Note: You only see the languages installed in that instance.) Add a language: koha-translate -i nl-NL -d yourinstance. Remove a language: koha-translate -r nl-NL -d yourinstance. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> EDIT (Feb 10, 2017): Added KOHA_CONF variable when calling translate. (Needed on kohadevbox.)
PERL5DIR typo ??
Created attachment 60114 [details] [review] Bug 16749: Adjustments for koha-translate [1] Add a -d|--dev parameter for dev installs. [2] KOHA_CONF is not needed in this script. [3] No hardcoded PERL5LIB, following bug 16733. [4] Adjust template paths for dev installs: OPAC_TMPL, INTRANET_TMPL. [5] Remove reference now to obsolete thems ccsr and prog. Test plan: [1] Regular package install: Run koha-translate -l to show installed languages. Run koha-translate -l -a to show available languages. Add a language: koha-translate -i nl-NL. Check the nl-NL folder. Remove a language: koha-translate -r nl-NL. Check again. [2] If you have a dev install too, try: Add the <dev_install> line to koha-conf.xml. (See 16733.) Run koha-translate -l -d yourinstance to show installed languages. (Note: You only see the languages installed in that instance.) Add a language: koha-translate -i nl-NL -d yourinstance. Remove a language: koha-translate -r nl-NL -d yourinstance. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> EDIT (Feb 10, 2017): Fixed a typ PERL5DIR. Decided to not pass KOHA_CONF after all.
Created attachment 60125 [details] [review] Bug 16749: Adjustments for koha-translate [AMENDED February 10, 2017] [1] Add a -d|--dev parameter for dev installs. [2] No hardcoded PERL5LIB or KOHA_INSTALL_DIR (KOHA_HOME). They are read from /etc/default or set by adjust_paths_dev_install. [3] Adjust template paths for dev installs: OPAC_TMPL, INTRANET_TMPL. [4] Remove references to obsolete themes ccsr and prog. Test plan: [1] Regular package install: Run koha-translate -l to show installed languages. Run koha-translate -l -a to show available languages. Add a language: koha-translate -i nl-NL. Check the nl-NL folder. Remove a language: koha-translate -r nl-NL. Check again. [2] Dev install or kohadevbox: If needed, add the <dev_install> line to koha-conf.xml. Run koha-translate -l -d yourinstance to show installed languages. (Note: You only see the languages installed in that instance.) Add a language: koha-translate -i nl-NL -d yourinstance. Remove a language: koha-translate -r nl-NL -d yourinstance. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 60126 [details] [review] Bug 16749: Adjustments for koha-translate [AMENDED February 10, 2017] [1] Added reading /etc/default as in the other debian scripts. Used later. [2] Add a -d|--dev parameter for dev installs. [3] No hardcoded PERL5LIB or KOHA_INSTALL_DIR (KOHA_HOME). They are read from /etc/default or set by adjust_paths_dev_install. [4] Adjust template paths for dev installs: OPAC_TMPL, INTRANET_TMPL. [5] Remove references to obsolete themes ccsr and prog. Test plan: [1] Regular package install: Run koha-translate -l to show installed languages. Run koha-translate -l -a to show available languages. Add a language: koha-translate -i nl-NL. Check the nl-NL folder. Remove a language: koha-translate -r nl-NL. Check again. [2] Dev install or kohadevbox: If needed, add the <dev_install> line to koha-conf.xml. Run koha-translate -l -d yourinstance to show installed languages. (Note: You only see the languages installed in that instance.) Add a language: koha-translate -i nl-NL -d yourinstance. Remove a language: koha-translate -r nl-NL -d yourinstance. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 60129 [details] [review] Bug 16749: Adjust xmlstarlet calls in koha-functions In various scripts we use xmlstarlet to extract values from koha-conf. If we call xmlstarlet on non-existing entries in koha-conf, this may however result in silently failing scripts (when set -e is in effect). A function run_safe_xmlstarlet is added for situations where the entry might not exist. It will not halt execution. This patch only adjusts koha-functions.sh and modifies the xmlstarlet calls for dev_install and zebra_loglevels. Note: The function does not need to check file existence. If the file does not exist, xmlstarlet warns about it; the function returns empty string, but does not set an error exit status. Test plan: See second patch ("koha-plack adjustments"). Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 60130 [details] [review] Bug 16749: Adjustments for koha-plack [1] Use run_safe_xmlstarlet for plack workers and requests [2] Simplify adjust_paths. The lazy export statement is actually enough to replace adjust_paths by one direct call to adjust_paths_dev_install. Test plan: [1] Copy koha-functions.sh and koha-plack: cp [YOUR_PATH]/debian/scripts/koha-functions.sh /usr/share/koha/bin/ cp [YOUR_PATH]/debian/scripts/koha-plack /usr/sbin/ where YOUR_PATH might well be /home/vagrant/kohaclone. [2] Make sure that you have dev_install in koha-conf. Stop and start koha-plack. Verify with ps aux|grep plack. [3] Rename dev_install to nodev_install (in start and end tag). Now stop/start koha-plack. Verify with ps aux|grep plack. [4] Change plack_requests to 51 in your koha-conf. Restart Plack and check that you see 51 in ps aux|grep plack. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested on Jessie (Debian VM and Kohadevbox)
Created attachment 60131 [details] [review] Bug 16749: Adjustments for koha-translate [AMENDED February 10, 2017] [1] Added reading /etc/default/koha-common as in the other debian scripts. We need it for KOHA_HOME. [2] Add a -d|--dev parameter for dev installs. [3] No hardcoded PERL5LIB or KOHA_INSTALL_DIR (KOHA_HOME). They are read from default file or set by adjust_paths_dev_install. [4] Adjust template paths for dev installs: OPAC_TMPL, INTRANET_TMPL. [5] Remove references to obsolete themes ccsr and prog. Test plan: [1] Regular package install: Copy koha-translate to /usr/sbin. Run koha-translate -l to show installed languages. Run koha-translate -l -a to show available languages. Add a language: koha-translate -i nl-NL. Check template folders in regular location (/usr/share/koha/...) Remove a language: koha-translate -r nl-NL. Check again. [2] Dev install or kohadevbox: Copy koha-translate to /usr/sbin. If needed, add the <dev_install> line to koha-conf.xml. Run koha-translate -l -d yourinstance to show installed languages. (Note: You only see the languages installed in this instance.) Add a language: koha-translate -i nl-NL -d yourinstance. Check template folders in the clone. Remove a language: koha-translate -r nl-NL -d yourinstance. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 60132 [details] [review] Bug 16749: Adjustments for koha-translate [AMENDED February 10, 2017] [1] Added reading /etc/default/koha-common as in the other debian scripts. We need it for KOHA_HOME. [2] Add a -d|--dev parameter for dev installs. [3] No hardcoded PERL5LIB or KOHA_INSTALL_DIR (KOHA_HOME). They are read from default file or set by adjust_paths_dev_install. [4] Adjust template paths for dev installs: OPAC_TMPL, INTRANET_TMPL. [5] Remove references to obsolete themes ccsr and prog. Test plan: [1] Regular package install: Copy koha-translate to /usr/sbin. Run koha-translate -l to show installed languages. Run koha-translate -l -a to show available languages. Add a language: koha-translate -i nl-NL. Check template folders in regular location (/usr/share/koha/...) Remove a language: koha-translate -r nl-NL. Check again. [2] Dev install or kohadevbox: Copy koha-translate to /usr/sbin. If needed, add the <dev_install> line to koha-conf.xml. Run koha-translate -l -d yourinstance to show installed languages. (Note: You only see the languages installed in this instance.) Add a language: koha-translate -i nl-NL -d yourinstance. Check template folders in the clone. Remove a language: koha-translate -r nl-NL -d yourinstance. Note: Make sure you have sufficient file permissions for the kohaclone files and koha-conf.xml. On kohadevbox you might need to run sudo koha-translate within the the vagrant user context. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested on Jessie (Debian VM and Kohadevbox)
Created attachment 60139 [details] [review] Bug 16749: Update debian docs for koha-translate This patch adds the -d option to the documentation (with thanks to Magnus Enger).
Created attachment 60140 [details] [review] Bug 16749: Go with a boolean flag, we love booleans As requested by Jonathan on comment 10 on Bugzilla and supported by Tomas, we should use the dev_install entry in koha-conf as a boolean flag. Since we already used it as a path, this patch is not too strict about it. If the entry is not empty and not equal to "0", we will interpret it as a true value. The path is taken from the intranetdir entry. Test plan: [1] Copy debian/scripts/koha-functions.sh to /usr/share/koha/bin [2] For a dev install: Remove the dev install line, or toggle its value between empty string, 0 or 1 and each time test stop/start koha-indexer. Check the path to rebuild_zebra with ps aux|grep indexer. If you have no entry, an empty entry or a zero, you should see a regular path. (Note: You can do something similar with koha-start-sip.) [3] For a regular install: Remove the dev install line. Stop/start koha-indexer or koha-plack, and verify that it still works. Add a dev_install line with 0, and repeat stop/start. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
This should do it for now. We need these patches following 16733 in 17.05 (especially the first two). Have been testing them quite extensively. Hoping for further attention soon..
This patch set appears to fix the koha-common.postinst error presumably introduced in bug 16733.
I have tested patch 3 and 4 in a regular package installation of master+all patches from this bug and they work. I can also confirm that the postinst issue is gone with this patch set. i tried plack_requests from the test plan in patch 2 in koha-conf.xml but it did not have any effect in the regular installation. I may be missing a parameter or it is not applicable for a regular install?
(In reply to Mirko Tietgen from comment #38) > I have tested patch 3 and 4 in a regular package installation of master+all > patches from this bug and they work. I can also confirm that the postinst > issue is gone with this patch set. > > i tried plack_requests from the test plan in patch 2 in koha-conf.xml but it > did not have any effect in the regular installation. I may be missing a > parameter or it is not applicable for a regular install? Thanks for testing. Should work on a regular instance too. Just to be sure: Master up-to-date including 17610? Did you copy the debian scripts from the master clone to /usr/sbin? And koha-functions.sh to /usr/share/koha/bin? And did you edit the koha-conf of the instance for which you are restarting plack? This setting is instance specific. You should see something like (52 coming from my koha-conf): master-+ 28433 0.0 0.1 61320 14636 ? Ss 18:57 0:00 starman master -M FindBin --max-requests 52 --workers 2 --user=master-koha --group master-koha --pid /var/run/koha/master/plack.pid --daemonize --access-log /var/log/koha/master/plack.log --error-log /var/log/koha/master/plack-error.log -E deployment --socket /var/run/koha/master/plack.sock /etc/koha/plack.psgi
I did not copy anything, I built a Debian package, so everything is in place already. I edited the correct instance koha-conf file. According to bug 17610 it is plack_max_requests, not plack_requests. I will try that.
(In reply to Mirko Tietgen from comment #40) > I did not copy anything, I built a Debian package, so everything is in place > already. I edited the correct instance koha-conf file. > > According to bug 17610 it is plack_max_requests, not plack_requests. I will > try that. Oh sorry! You are of course completely right: <plack_max_requests>52</plack_max_requests> <plack_workers>2</plack_workers> These unreliable test plans :)
Created attachment 60193 [details] [review] Bug 16749: Adjust xmlstarlet calls in koha-functions In various scripts we use xmlstarlet to extract values from koha-conf. If we call xmlstarlet on non-existing entries in koha-conf, this may however result in silently failing scripts (when set -e is in effect). A function run_safe_xmlstarlet is added for situations where the entry might not exist. It will not halt execution. This patch only adjusts koha-functions.sh and modifies the xmlstarlet calls for dev_install and zebra_loglevels. Note: The function does not need to check file existence. If the file does not exist, xmlstarlet warns about it; the function returns empty string, but does not set an error exit status. Test plan: See second patch ("koha-plack adjustments"). Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Tested in a package installation of master+16749
Created attachment 60194 [details] [review] Bug 16749: Adjustments for koha-plack [1] Use run_safe_xmlstarlet for plack workers and requests [2] Simplify adjust_paths. The lazy export statement is actually enough to replace adjust_paths by one direct call to adjust_paths_dev_install. Test plan: [1] Copy koha-functions.sh and koha-plack: cp [YOUR_PATH]/debian/scripts/koha-functions.sh /usr/share/koha/bin/ cp [YOUR_PATH]/debian/scripts/koha-plack /usr/sbin/ where YOUR_PATH might well be /home/vagrant/kohaclone. [2] Make sure that you have dev_install in koha-conf. Stop and start koha-plack. Verify with ps aux|grep plack. [3] Rename dev_install to nodev_install (in start and end tag). Now stop/start koha-plack. Verify with ps aux|grep plack. [4] Change plack_requests to 51 in your koha-conf. Restart Plack and check that you see 51 in ps aux|grep plack. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested on Jessie (Debian VM and Kohadevbox) Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Tested in a package installation of master+16749
Created attachment 60195 [details] [review] Bug 16749: Adjustments for koha-translate [AMENDED February 10, 2017] [1] Added reading /etc/default/koha-common as in the other debian scripts. We need it for KOHA_HOME. [2] Add a -d|--dev parameter for dev installs. [3] No hardcoded PERL5LIB or KOHA_INSTALL_DIR (KOHA_HOME). They are read from default file or set by adjust_paths_dev_install. [4] Adjust template paths for dev installs: OPAC_TMPL, INTRANET_TMPL. [5] Remove references to obsolete themes ccsr and prog. Test plan: [1] Regular package install: Copy koha-translate to /usr/sbin. Run koha-translate -l to show installed languages. Run koha-translate -l -a to show available languages. Add a language: koha-translate -i nl-NL. Check template folders in regular location (/usr/share/koha/...) Remove a language: koha-translate -r nl-NL. Check again. [2] Dev install or kohadevbox: Copy koha-translate to /usr/sbin. If needed, add the <dev_install> line to koha-conf.xml. Run koha-translate -l -d yourinstance to show installed languages. (Note: You only see the languages installed in this instance.) Add a language: koha-translate -i nl-NL -d yourinstance. Check template folders in the clone. Remove a language: koha-translate -r nl-NL -d yourinstance. Note: Make sure you have sufficient file permissions for the kohaclone files and koha-conf.xml. On kohadevbox you might need to run sudo koha-translate within the the vagrant user context. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested on Jessie (Debian VM and Kohadevbox) Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Tested in a package installation of master+16749
Created attachment 60196 [details] [review] Bug 16749: Update debian docs for koha-translate This patch adds the -d option to the documentation (with thanks to Magnus Enger). Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Tested in a package installation of master+16749
Created attachment 60197 [details] [review] Bug 16749: Go with a boolean flag, we love booleans As requested by Jonathan on comment 10 on Bugzilla and supported by Tomas, we should use the dev_install entry in koha-conf as a boolean flag. Since we already used it as a path, this patch is not too strict about it. If the entry is not empty and not equal to "0", we will interpret it as a true value. The path is taken from the intranetdir entry. Test plan: [1] Copy debian/scripts/koha-functions.sh to /usr/share/koha/bin [2] For a dev install: Remove the dev install line, or toggle its value between empty string, 0 or 1 and each time test stop/start koha-indexer. Check the path to rebuild_zebra with ps aux|grep indexer. If you have no entry, an empty entry or a zero, you should see a regular path. (Note: You can do something similar with koha-start-sip.) [3] For a regular install: Remove the dev install line. Stop/start koha-indexer or koha-plack, and verify that it still works. Add a dev_install line with 0, and repeat stop/start. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Tested in a package installation of master+16749
(In reply to Mirko Tietgen from comment #46) > Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Great, thanks.
Why do not we use the dev_install flag for koha-translate?
(In reply to Jonathan Druart from comment #48) > Why do not we use the dev_install flag for koha-translate? Why not leave koha-translate alone? Remember there might be dev and non-dev installs. It is easy to just go to the source code and run perl translate install <code>. And koha-translate is system-wide, so not attached to a specific instance
(In reply to Jonathan Druart from comment #48) > Why do not we use the dev_install flag for koha-translate? Because we do not pass an instance name when using it for regular installs.
(In reply to Tomás Cohen Arazi from comment #49) > (In reply to Jonathan Druart from comment #48) > > Why do not we use the dev_install flag for koha-translate? > > Why not leave koha-translate alone? Remember there might be dev and non-dev > installs. It is easy to just go to the source code and run perl translate > install <code>. And koha-translate is system-wide, so not attached to a > specific instance It is not that hard to make it work. The patch may prove that. Any specific objection ?
(In reply to Marcel de Rooy from comment #51) > (In reply to Tomás Cohen Arazi from comment #49) > > (In reply to Jonathan Druart from comment #48) > > > Why do not we use the dev_install flag for koha-translate? > > > > Why not leave koha-translate alone? Remember there might be dev and non-dev > > installs. It is easy to just go to the source code and run perl translate > > install <code>. And koha-translate is system-wide, so not attached to a > > specific instance > > It is not that hard to make it work. The patch may prove that. > Any specific objection ? It felt a bit overkill to me, but no objections.
Created attachment 60335 [details] [review] Bug 16749: Use is_instance to make sure the dev instance exist
% sudo koha-upgrade-schema failed to load external entity "/etc/koha/sites/dev_install/koha-conf.xml"
(In reply to Jonathan Druart from comment #54) > % sudo koha-upgrade-schema > failed to load external entity "/etc/koha/sites/dev_install/koha-conf.xml" Same for koha-rebuild-zebra, and certainly others.
What instances do you use and what command did you type?
Created attachment 60340 [details] [review] Bug 16749: Check instancename in adjust_paths_dev_install Check if the instance does not exist (or was not even passed).
Created attachment 60343 [details] [review] Bug 16749: Adjust xmlstarlet calls in koha-functions In various scripts we use xmlstarlet to extract values from koha-conf. If we call xmlstarlet on non-existing entries in koha-conf, this may however result in silently failing scripts (when set -e is in effect). A function run_safe_xmlstarlet is added for situations where the entry might not exist. It will not halt execution. This patch only adjusts koha-functions.sh and modifies the xmlstarlet calls for dev_install and zebra_loglevels. Note: The function does not need to check file existence. If the file does not exist, xmlstarlet warns about it; the function returns empty string, but does not set an error exit status. Test plan: See second patch ("koha-plack adjustments"). Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Tested in a package installation of master+16749 Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 60344 [details] [review] Bug 16749: Adjustments for koha-plack [1] Use run_safe_xmlstarlet for plack workers and requests [2] Simplify adjust_paths. The lazy export statement is actually enough to replace adjust_paths by one direct call to adjust_paths_dev_install. Test plan: [1] Copy koha-functions.sh and koha-plack: cp [YOUR_PATH]/debian/scripts/koha-functions.sh /usr/share/koha/bin/ cp [YOUR_PATH]/debian/scripts/koha-plack /usr/sbin/ where YOUR_PATH might well be /home/vagrant/kohaclone. [2] Make sure that you have dev_install in koha-conf. Stop and start koha-plack. Verify with ps aux|grep plack. [3] Rename dev_install to nodev_install (in start and end tag). Now stop/start koha-plack. Verify with ps aux|grep plack. [4] Change plack_requests to 51 in your koha-conf. Restart Plack and check that you see 51 in ps aux|grep plack. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested on Jessie (Debian VM and Kohadevbox) Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Tested in a package installation of master+16749 Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 60345 [details] [review] Bug 16749: Adjustments for koha-translate [AMENDED February 10, 2017] [1] Added reading /etc/default/koha-common as in the other debian scripts. We need it for KOHA_HOME. [2] Add a -d|--dev parameter for dev installs. [3] No hardcoded PERL5LIB or KOHA_INSTALL_DIR (KOHA_HOME). They are read from default file or set by adjust_paths_dev_install. [4] Adjust template paths for dev installs: OPAC_TMPL, INTRANET_TMPL. [5] Remove references to obsolete themes ccsr and prog. Test plan: [1] Regular package install: Copy koha-translate to /usr/sbin. Run koha-translate -l to show installed languages. Run koha-translate -l -a to show available languages. Add a language: koha-translate -i nl-NL. Check template folders in regular location (/usr/share/koha/...) Remove a language: koha-translate -r nl-NL. Check again. [2] Dev install or kohadevbox: Copy koha-translate to /usr/sbin. If needed, add the <dev_install> line to koha-conf.xml. Run koha-translate -l -d yourinstance to show installed languages. (Note: You only see the languages installed in this instance.) Add a language: koha-translate -i nl-NL -d yourinstance. Check template folders in the clone. Remove a language: koha-translate -r nl-NL -d yourinstance. Note: Make sure you have sufficient file permissions for the kohaclone files and koha-conf.xml. On kohadevbox you might need to run sudo koha-translate within the the vagrant user context. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested on Jessie (Debian VM and Kohadevbox) Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Tested in a package installation of master+16749 Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 60346 [details] [review] Bug 16749: Update debian docs for koha-translate This patch adds the -d option to the documentation (with thanks to Magnus Enger). Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Tested in a package installation of master+16749 Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 60347 [details] [review] Bug 16749: Go with a boolean flag, we love booleans As requested by Jonathan on comment 10 on Bugzilla and supported by Tomas, we should use the dev_install entry in koha-conf as a boolean flag. Since we already used it as a path, this patch is not too strict about it. If the entry is not empty and not equal to "0", we will interpret it as a true value. The path is taken from the intranetdir entry. Test plan: [1] Copy debian/scripts/koha-functions.sh to /usr/share/koha/bin [2] For a dev install: Remove the dev install line, or toggle its value between empty string, 0 or 1 and each time test stop/start koha-indexer. Check the path to rebuild_zebra with ps aux|grep indexer. If you have no entry, an empty entry or a zero, you should see a regular path. (Note: You can do something similar with koha-start-sip.) [3] For a regular install: Remove the dev install line. Stop/start koha-indexer or koha-plack, and verify that it still works. Add a dev_install line with 0, and repeat stop/start. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> Tested in a package installation of master+16749 Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 60348 [details] [review] Bug 16749: Use is_instance to make sure the dev instance exist Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 60349 [details] [review] Bug 16749: Check instancename in adjust_paths_dev_install Check if the instance does not exist (or was not even passed). Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 60350 [details] [review] Bug 16749: Add is_instance check to koha-upgrade-schema Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 17.05, thanks Marcel, Jonathan!
Depends on bug 16733 which is not in 16.11.x. This won't get ported back to 16.11.x as it is an enhancement.
These patches have been pushed to 16.11.x and will be in 16.11.08.
Blocked by Enhancement, skipping for 16.05.x
*** Bug 16226 has been marked as a duplicate of this bug. ***