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

Bug 710604

Summary: dev-db/mysql-init-scripts: tidy up conf.d file slightly by using compound command instead of control operator
Product: Gentoo Linux Reporter: Kerin Millar <kfm>
Component: Current packagesAssignee: Gentoo Linux MySQL bugs team <mysql-bugs>
Status: CONFIRMED ---    
Severity: enhancement    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Kerin Millar 2020-02-23 19:50:41 UTC
Currently, the conf.d file ends with the following code:-

# The conditional above has a false-positive "failure" return value as a
# side-effect, and since it's the last statement, without the next line, this
# script returns failure.
return 0

It seems somewhat laboured. The underlying problem can be solved by using if:-

if [ "${SVCNAME}" != mysql ]; then
   rc_provide="!mysql"
fi

Alternatively, for those that insist on one-liners:-

if [ "${SVCNAME}" != mysql ]; then rc_provide="!mysql"; fi

Thereafter, the return statement - along with its distracting comment - may be removed.