Created attachment 507952 [details] app-admin/syslog-ng-3.12.1:20171203-204910.log * Messages for package app-admin/syslog-ng-3.12.1: * Log file: /var/log/portage/build/app-admin/syslog-ng-3.12.1:20171203-204910.log * For detailed documentation please see the upstream website: * https://www.balabit.com/sites/default/files/documents/syslog-ng-ose-3.12-guides/en/syslog-ng-ose-v3.12-guide-admin/html/index.html * QA Notice: shell script appears to use non-POSIX feature(s): * possible bashism in /etc/init.d/syslog-ng line 49 (alternative test command ([[ foo ]] should be [ foo ])): * [[ "$RC_CMD" == "restart" ]] && sleep 1 * possible bashism in /etc/init.d/syslog-ng line 49 (should be 'b = a'): * [[ "$RC_CMD" == "restart" ]] && sleep 1
Ironically, the pull request had this right and monsieurp changed it when committing. Assigning to him to fix (since nobody added a maintainer).
Further, the new runscript completely breaks the assignment of default variable values. I commented on this at bug #592920. Between that and the bashism reported here, there are no other changes. Therefore, I would suggest jettisoning the new runscript altogether and continuing to use the one that currently resides at "$FILESDIR/3.7/syslog-ng.rc6".
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd18ea8355ebfd3a657958a3989587274ab6813c commit dd18ea8355ebfd3a657958a3989587274ab6813c Author: Patrice Clement <monsieurp@gentoo.org> AuthorDate: 2017-12-04 00:44:56 +0000 Commit: Patrice Clement <monsieurp@gentoo.org> CommitDate: 2017-12-04 00:44:56 +0000 app-admin/syslog-ng: fix QA warning. Closes: https://bugs.gentoo.org/639672 Package-Manager: Portage-2.3.13, Repoman-2.3.3 app-admin/syslog-ng/files/3.12/syslog-ng.rc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
Thanks Patrice, but while the commit addresses the improper assignment syntax, it doesn't actually fix the QA warning that is the topic of this bug, which is a distinct issue. If you were to fix the line that eroen mentions, that would be the end of it. Specifically, change this: [[ "$RC_CMD" == "restart" ]] && sleep 1 ... to this: [ "$RC_CMD" = "restart" ] && sleep 1 Yes, == is also a bashism. For more info, I can warmly recommend http://mywiki.wooledge.org/Bashism and https://www.shellcheck.net/.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73eb9782813b4e604f66d4334d1f73e97c0f9aa9 commit 73eb9782813b4e604f66d4334d1f73e97c0f9aa9 Author: Patrice Clement <monsieurp@gentoo.org> AuthorDate: 2017-12-04 08:34:47 +0000 Commit: Patrice Clement <monsieurp@gentoo.org> CommitDate: 2017-12-04 08:34:47 +0000 app-admin/syslog-ng: remove bashism. Bug: https://bugs.gentoo.org/639672 Package-Manager: Portage-2.3.13, Repoman-2.3.3 app-admin/syslog-ng/files/3.12/syslog-ng.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)}
Sorry about that btw. I really thought I was doing the right thing. :(
We're testing with Tomas and it turns out the following statement isn't actually a bash-ism per se: : $var but: [[ $foo == "bar" ]] is. So my assumption was correct except for the [[ ]] which I knew is a bash-ism and shouldn't have written. We'll fix that (again) in the next version bump of syslog-ng.
Thank you guys for the input and Patrice for fixing it. I believe we should have a good and working syslog-ng in portage. Patrice, everybody makes mistakes, thank you for your quick actions by reverting it to a working state. It's only good you wanted to make it better, well, it's a testing version, so breakage occurs sometimes :)
Indeed, `:` is not a bashism. As an outsider, I'm curious as to whether anyone (or repoman) claimed that it was. Ihe shell grammar, a "simple command" requires that the assignments be declared prior to the word that is interpreted as the command - or builtin - to be executed. As I mentioned in the other bug, to induce assignment in any other context requires the use of a form of parameter expansion that has this specific characteristic. This is just as true of sh as it is of bash, and they both support the ${parameter:=word} method, if that's what you want. My feeling, for what it is worth, is that this technique is sufficiently obscure that it should be avoided. The main thing is that the the code functions as intended. In any case, thank you for updating syslog-ng!
Thank you for fixing this! I don't know what the rules are, but I guess you should bump the release (-rN) next time (maybe I'm wrong), in my case I don't reboot often, also I use portage snapshots, and after reboot I saw that service failed to start, but on other ~amd64 box it worked fine, I did work around it by uncommenting variables in /etc/conf.d/syslog-ng, but later I tried to investigate since both systems have same version of syslog-ng, and I found that init script was different, then I reinstalled problematic syslong-ng and it was fine which was weird, then I looked at portage tree git log and found this change ( dd18ea8355ebfd3a657958a3989587274ab6813c ). Or maybe it's my fault not seeing QA notices, not sure if '--quiet-build' affects displaying those?
Probably it just happened too quickly and thus we forgot to revbump. I agree it would have been a cleaner solution as it wasn't a build time failure.