Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 620818 - sci-misc/boinc: relies on a lot of bashisms
Summary: sci-misc/boinc: relies on a lot of bashisms
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Eden
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 609070
  Show dependency tree
 
Reported: 2017-06-04 17:08 UTC by Michał Górny
Modified: 2017-07-05 13:15 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-06-04 17:08:58 UTC
OpenRC is built on POSIX-ish shell script, and runs using /bin/sh. Therefore, all init.d scripts need to comply with POSIX shell features (plus common thingies like 'local').

$ checkbashisms -f files/boinc.init 
possible bashism in files/boinc.init line 14 (alternative test command ([[ foo ]] should be [ foo ])):
	if [[ ! -d "${RUNTIMEDIR}" ]]; then
possible bashism in files/boinc.init line 17 (alternative test command ([[ foo ]] should be [ foo ])):
		if [[ ! -d "${RUNTIMEDIR}" ]]; then
possible bashism in files/boinc.init line 26 (alternative test command ([[ foo ]] should be [ foo ])):
	if [[ ! -e "${RUNTIMEDIR}"/ca-bundle.crt ]]; then
possible bashism in files/boinc.init line 40 (alternative test command ([[ foo ]] should be [ foo ])):
	if [[ -h "${libtarget}" ]] \
	&& [[ "${libsource}" != "$(readlink "${libtarget}")" ]]; then
possible bashism in files/boinc.init line 47 (alternative test command ([[ foo ]] should be [ foo ])):
	if [[ -n "${libsource}" ]] \
	&& [[ -f "${libsource}" ]] \
	&& [[ ! -h "${libtarget}" ]]; then
possible bashism in files/boinc.init line 67 (alternative test command ([[ foo ]] should be [ foo ])):
	if [[ ! -x "$BOINCBIN" ]]; then
possible bashism in files/boinc.init line 74 (alternative test command ([[ foo ]] should be [ foo ])):
	if [[ ! -x "$BOINCCMD" ]]; then
possible bashism in files/boinc.init line 100 (alternative test command ([[ foo ]] should be [ foo ])):
	if [[ ! -f "${RUNTIMEDIR}/lockfile" ]]; then
possible bashism in files/boinc.init line 116 (alternative test command ([[ foo ]] should be [ foo ])):
	if [[ "${ALLOW_REMOTE_RPC}" = "yes" ]]; then
possible bashism in files/boinc.init line 160 (sleep only takes one integer):
	sleep 10s
possible bashism in files/boinc.init line 198 (bash arrays, ${name[0|*|@]}):
	for url in "${master_urls[@]}"; do
possible bashism in files/boinc.init line 223 (bash arrays, ${name[0|*|@]}):
	for url in "${master_urls[@]}"; do
Comment 1 Sven Eden 2017-06-05 12:27:20 UTC
Okay, that is new.
I'd like to fix that, shouldn't be a problem.

However, not using bash arrays will make the script a bit ugly I guess... :-(
Comment 2 Sven Eden 2017-06-07 10:31:29 UTC
I have updated the script, but want to combine a needed revbump with the fix of bug 609522. The bug doesn't really block this one, the block is just a reminder for me.
Comment 3 Sven Eden 2017-06-09 08:32:27 UTC
Created PR https://github.com/gentoo/gentoo/pull/4887
Comment 4 Sven Eden 2017-07-05 13:15:58 UTC
Fixed in https://github.com/gentoo/gentoo/commit/2e1256f