Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 482070 - =app-admin/collectd-5.4.0 - Possible bashisms found in /etc/init.d/collectd (lines 24 - 26)
Summary: =app-admin/collectd-5.4.0 - Possible bashisms found in /etc/init.d/collectd (...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Johan Bergström
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-22 09:34 UTC by Tom Wijsman (TomWij) (RETIRED)
Modified: 2013-09-08 14:33 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
init-nobashisms.diff (init-nobashisms.diff,853 bytes, patch)
2013-08-24 07:16 UTC, Johan Bergström
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-08-22 09:34:44 UTC
* QA Notice: shell script appears to use non-POSIX feature(s):
 *    possible bashism in /etc/init.d/collectd line 24 (alternative test command ([[ foo ]] should be [ foo ])):
 *    	if [[ $(sed '/^$\|^#/d' ${COLLECTD_CFGFILE} | grep -c 'LoadPlugin\w\+oracle') != 0 ]] ; then
 *    possible bashism in /etc/init.d/collectd line 25 (alternative test command ([[ foo ]] should be [ foo ])):
 *    		if [[ -e /etc/env.d/50oracle-instantclient-basic ]] ; then
 *    possible bashism in /etc/init.d/collectd line 26 (should be '.', not 'source'):
 *    			source /etc/env.d/50oracle-instantclient-basic
Comment 1 Johan Bergström 2013-08-24 07:16:21 UTC
Created attachment 356834 [details, diff]
init-nobashisms.diff

Not sure if this warrants a -r1 of the init script, but attached is a diff that fixes these QA warnings. Haven't tested on !bash (last time I went busybox sh a lot of things started breaking), but hopefully this is it.

Out of curiosity, how do you run that QA check? Seems to be part of misc-functions.sh, but can't find it.
Comment 2 Markos Chandras (RETIRED) gentoo-dev 2013-09-08 14:33:14 UTC
+  08 Sep 2013; Markos Chandras <hwoarang@gentoo.org> files/collectd.initd:
+  Avoid bashisms in init script. Bug #482070 thanks to Johan Bergström
+  <bugs@bergstroem.nu>
+