Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 710604 - dev-db/mysql-init-scripts: tidy up conf.d file slightly by using compound command instead of control operator
Summary: dev-db/mysql-init-scripts: tidy up conf.d file slightly by using compound com...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-23 19:50 UTC by kfm
Modified: 2020-02-23 19:50 UTC (History)
0 users

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 kfm 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.