mirror of
https://github.com/godotengine/buildroot.git
synced 2026-01-02 21:48:20 +03:00
When running "make check-package" on a system with shellcheck 0.9.0,
the command fails with output:
make check-package
package/linux-tools/S10hyperv:0: run 'shellcheck' and fix the warnings
...
2 warnings generated
This commit fixes the warnings reported by the command:
shellcheck package/linux-tools/S10hyperv
This commit also fixes the four-space indent by a single tab on the
changed lines. Since this fixes the indentation warnings of
check-package, the Indent exclusion in .checkpackageignore is also
removed.
Fixes:
In package/linux-tools/S10hyperv line 27:
return $ret
^--^ SC2086 (info): Double quote to prevent globbing and word splitting.
In package/linux-tools/S10hyperv line 48:
return $ret
^--^ SC2086 (info): Double quote to prevent globbing and word splitting.
Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
67 lines
1.1 KiB
Bash
67 lines
1.1 KiB
Bash
#!/bin/sh
|
|
|
|
PROGS="@PROGS@"
|
|
PIDDIR="/var/run"
|
|
|
|
# shellcheck source=/dev/null
|
|
[ -r "/etc/default/hyperv" ] && . "/etc/default/hyperv"
|
|
|
|
start_one() {
|
|
printf 'Starting %s: ' "$1"
|
|
# shellcheck disable=SC2086 # we need the word splitting
|
|
start-stop-daemon -b -m -S -q -p "$PIDDIR/$1.pid" -x "/sbin/$1" -- -n
|
|
status=$?
|
|
if [ "$status" -eq 0 ]; then
|
|
echo "OK"
|
|
else
|
|
echo "FAIL"
|
|
fi
|
|
return $status
|
|
}
|
|
|
|
start() {
|
|
# shellcheck disable=SC2086 # we need the word splitting
|
|
for prog in ${PROGS}; do
|
|
start_one "${prog}" || ret=$?
|
|
done
|
|
return "$ret"
|
|
}
|
|
|
|
stop_one() {
|
|
printf 'Stopping %s: ' "$1"
|
|
start-stop-daemon -K -q -p "$PIDDIR/$1.pid"
|
|
status=$?
|
|
if [ "$status" -eq 0 ]; then
|
|
rm -f "$PIDDIR/$1.pid"
|
|
echo "OK"
|
|
else
|
|
echo "FAIL"
|
|
fi
|
|
return $status
|
|
}
|
|
|
|
stop() {
|
|
# shellcheck disable=SC2086 # we need the word splitting
|
|
for prog in ${PROGS}; do
|
|
stop_one "${prog}" || ret=$?
|
|
done
|
|
return "$ret"
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
sleep 1
|
|
start
|
|
}
|
|
|
|
case "$1" in
|
|
start|stop|restart)
|
|
"$1";;
|
|
reload)
|
|
# Restart, since there is no true "reload" feature.
|
|
restart;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|reload}"
|
|
exit 1
|
|
esac
|