Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 620818

Summary: sci-misc/boinc: relies on a lot of bashisms
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Sven Eden <sven.eden>
Status: RESOLVED FIXED    
Severity: normal CC: sci
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 609070    

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