When installing a custom Koha 19.11.05, I got the following error: /var/lib/dpkg/info/koha-common.postinst: 155: [: !log4perl_component: unexpected operator I don't think we should be using the square brackets in that line at all and should put a space between ! and log4perl_component.
Created attachment 104912 [details] [review] Bug 25510: Fix shell syntax for updating log4perl.conf for instances This patch fixes the shell syntax when updating log4perl.conf for instances.
So Koha install is broken using the Debian package?
If I execute: log4perl_component() { local config=$1 local component=$2 if [ grep -q -x "log4perl.logger.$component" $config ]; then return 0 else return 1 fi } for site in $(koha-list); do log4perl_config="/etc/koha/sites/$site/log4perl.conf" if ! log4perl_component $log4perl_config "sip"; then echo $site fi done I get xxx.pl: line 67: [: too many arguments Looks like we need another change
Created attachment 104921 [details] [review] Bug 25510: Fix syntax error in koha-common.postinst
Comment on attachment 104912 [details] [review] Bug 25510: Fix shell syntax for updating log4perl.conf for instances This patch is not sufficient for master.
IIUC from various IRC discussions, the cleanest[1] way to test package install patches while being simple[1] enough to be less likely to messed things up is: - apply comment 4 - make packages with https://hub.docker.com/r/koha/koha-dpkg - spin a standard Debian (9?) however one wants (container, VM, VPS) - install the packages following https://wiki.koha-community.org/wiki/Koha_on_Debian [1] for someone without experience with building packages and installing Koha from them
Anything missing?
(In reply to Jonathan Druart from comment #2) > So Koha install is broken using the Debian package? Arguably yes. The majority of the install works correctly, but it looks like it ditches out at the end of koha-common.postinst.
(In reply to Victor Grousset/tuxayo from comment #6) > IIUC from various IRC discussions, the cleanest[1] way to test package > install patches while being simple[1] enough to be less likely to messed > things up is: > > - apply comment 4 > - make packages with https://hub.docker.com/r/koha/koha-dpkg > - spin a standard Debian (9?) however one wants (container, VM, VPS) > - install the packages following > https://wiki.koha-community.org/wiki/Koha_on_Debian > > [1] for someone without experience with building packages and installing > Koha from them That's mostly correct, although "install the packages" would need to use either "apt install ./koha-common<blahblah>" or "dpkg -i koha-common<blahblah>" For making packages, I use my own Docker image (https://gitlab.com/minusdavid/koha-deb-builder-docker), but I imagine there's community support for https://hub.docker.com/r/koha/koha-dpkg, so that's probably better for someone without experience.
(In reply to David Cook from comment #9) > (In reply to Victor Grousset/tuxayo from comment #6) > > IIUC from various IRC discussions, the cleanest[1] way to test package > > install patches while being simple[1] enough to be less likely to messed > > things up is: > > > > - apply comment 4 > > - make packages with https://hub.docker.com/r/koha/koha-dpkg > > - spin a standard Debian (9?) however one wants (container, VM, VPS) > > - install the packages following > > https://wiki.koha-community.org/wiki/Koha_on_Debian > > > > [1] for someone without experience with building packages and installing > > Koha from them > > That's mostly correct, although "install the packages" would need to use > either "apt install ./koha-common<blahblah>" or "dpkg -i > koha-common<blahblah>" > > For making packages, I use my own Docker image > (https://gitlab.com/minusdavid/koha-deb-builder-docker), but I imagine > there's community support for https://hub.docker.com/r/koha/koha-dpkg, so > that's probably better for someone without experience. That's interesting, David. Mine is not community per-se. I like yours, might steal some of it for mine
(In reply to Tomás Cohen Arazi from comment #10) > That's interesting, David. Mine is not community per-se. I like yours, might > steal some of it for mine Cool ^_^. It's a work-in-progress, but I've been using it for a while and have it integrated in a CD pipeline, which is working pretty well.
(In reply to Jonathan Druart from comment #4) > Created attachment 104921 [details] [review] [review] > Bug 25510: Fix syntax error in koha-common.postinst I'm getting the following errors: /var/lib/dpkg/info/koha-common.postinst: 155: /var/lib/dpkg/info/koha-common.postinst: !log4perl_component: not found /var/lib/dpkg/info/koha-common.postinst: 168: /var/lib/dpkg/info/koha-common.postinst: !log4perl_component: not found /var/lib/dpkg/info/koha-common.postinst: 184: /var/lib/dpkg/info/koha-common.postinst: !log4perl_component: not found I think we need that space between the ! and the function name. I'll add a patch for that and try again.
Created attachment 105005 [details] [review] Bug 25510: Put space between negation operator and function name This patch puts a space between the negation operator ! and the function name (ie log4perl_component).
(In reply to David Cook from comment #13) > Created attachment 105005 [details] [review] [review] > Bug 25510: Put space between negation operator and function name > > This patch puts a space between the negation operator ! and > the function name (ie log4perl_component). With this patch, there are no longer error messages... but log4perl_component() doesn't look like it's working correctly because it just keeps appending to /etc/koha/sites/$site/log4perl.conf
(In reply to David Cook from comment #14) > With this patch, there are no longer error messages... but > log4perl_component() doesn't look like it's working correctly because it > just keeps appending to /etc/koha/sites/$site/log4perl.conf And it's because the grep in log4perl_component() is bad...
Note this affects 19.11 and not just master
Indeed, I had the space in my test script but did not correctly applied the changes :-/
Created attachment 105007 [details] [review] Bug 25510: Fix syntax error in koha-common.postinst Signed-off-by: David Cook <dcook@prosentient.com.au>
Created attachment 105008 [details] [review] Bug 25510: Put space between negation operator and function name This patch puts a space between the negation operator ! and the function name (ie log4perl_component). Signed-off-by: David Cook <dcook@prosentient.com.au>
(In reply to David Cook from comment #9) > (In reply to Victor Grousset/tuxayo from comment #6) > > - install the packages following > > https://wiki.koha-community.org/wiki/Koha_on_Debian > > That's mostly correct, although "install the packages" would need to use > either "apt install ./koha-common<blahblah>" or "dpkg -i > koha-common<blahblah>" `apt-get install koha-common` is indeed part of https://wiki.koha-community.org/wiki/Koha_on_Debian I feel I didn't get your meaning. Thanks a lot for the signing.
Created attachment 105052 [details] [review] Bug 25510: Fix syntax error in koha-common.postinst Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 105053 [details] [review] Bug 25510: Put space between negation operator and function name This patch puts a space between the negation operator ! and the function name (ie log4perl_component). Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Thanks Tomas :) We can't forget Bug 25524 either, as fixing Bug 25510 will cause Bug 25524 to become an issue.
(In reply to David Cook from comment #23) > Thanks Tomas :) > > We can't forget Bug 25524 either, as fixing Bug 25510 will cause Bug 25524 > to become an issue. I know. But internet gets painfully slow here around 8 pm with all the neighbours streamming Netflix et al, and I got pulled to the kitchen to make dinner :-D I have everything set to properly QA all this packaging bugs (koha-dpkg, vagrant+virtualbox) I just need more time as installing 19.11 (and deps) to test upgrades takes a lot of time here.
(In reply to Tomás Cohen Arazi from comment #24) > I know. But internet gets painfully slow here around 8 pm with all the > neighbours streamming Netflix et al, and I got pulled to the kitchen to make > dinner :-D > > I have everything set to properly QA all this packaging bugs (koha-dpkg, > vagrant+virtualbox) I just need more time as installing 19.11 (and deps) to > test upgrades takes a lot of time here. No worries. Very grateful for your work on these! I just didn't want to be responsible for adding bugs while fixing bugs heh.
Nice work everyone! Pushed to master for 20.05
19.11 mantainer: relaying here a message from bug 25524 comment 3 > 19.11 mantainer: this should be pushed at the same time we push 25510.
missing dependencies-not backported to 19.11.x
not sure how to push this to 19.11.x branch.
(In reply to Joy Nelson from comment #29) > not sure how to push this to 19.11.x branch. Oh right, it'll need a different patch, as the koha-common.postinst in 19.11 is a fair bit different to master. I did my own local 19.11 patch but I meant to put one up here too.
Created attachment 105134 [details] [review] [19.11] Bug 25510: Fix syntax error in koha-common.postinst Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 105135 [details] [review] [19.11] Bug 25510: Put space between negation operator and function name This patch puts a space between the negation operator ! and the function name (ie log4perl_component). Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Not sure what the process is for backporting, but someone in QA might want to look over those 19.11 patches. I haven't fully tested them. I just fixed the merge conflicts when applying the master patches.
Created attachment 105152 [details] [review] [19.11] Bug 25510: Fix syntax error in koha-common.postinst Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 105153 [details] [review] [19.11] Bug 25510: Put space between negation operator and function name This patch puts a space between the negation operator ! and the function name (ie log4perl_component). Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
19.11.x patches reviewed by Kyle and pushed by me for 19.11.06 Thanks!
Is 19.05 also affected?
(In reply to Joy Nelson from comment #36) > 19.11.x patches reviewed by Kyle and pushed by me for 19.11.06 > Thanks! Woo! You're welcome ^_^.
(In reply to Victor Grousset/tuxayo from comment #37) > Is 19.05 also affected? I don't think so. Since Bug 24905 wasn't pushed to 19.05, it should be safe. We skipped over 19.05 and are doing many upgrades to 19.11, so that's all I've been targeting at the moment for my work.
missing dependencies for 19.05.x, no backport