[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] New shellcheck 0.9 warnings
From: |
Vadim Zeitlin |
Subject: |
[lmi] New shellcheck 0.9 warnings |
Date: |
Thu, 5 Jan 2023 02:41:44 +0100 |
Hello,
If the change of the year wasn't enough to convince you of the passing of
time, here is another strike against Zeno's paradox: CI builds got broken
because shellcheck version in Debian Sid has changed from 0.8 to 0.9 and
the new one gives many new warnings which can be seen in full at e.g.
https://github.com/let-me-illustrate/lmi/actions/runs/3838997409/jobs/6536168165
but which I also paste here for convenience:
---------------------------------- >8 --------------------------------------
make[1]: Entering directory '/__w/lmi/lmi'
make[2]: 'test_coding_rules' is up to date.
make[1]: Leaving directory '/__w/lmi/lmi'
In /__w/lmi/lmi/gwc/allow_perf.sh line 33:
cd /usr/bin || { printf 'failed: cd\n'; exit 3; }
^----------^ SC2317 (info): Command appears to be unreachable. Check usage (or
ignore if invoked indirectly).
^-- SC2317 (info): Command appears to be unreachable. Check
usage (or ignore if invoked indirectly).
^-------------------^ SC2317 (info): Command appears to be
unreachable. Check usage (or ignore if invoked indirectly).
^----^ SC2317 (info): Command appears
to be unreachable. Check usage (or ignore if invoked indirectly).
In /__w/lmi/lmi/gwc/allow_perf.sh line 34:
groupadd perf_users
^-----------------^ SC2317 (info): Command appears to be unreachable. Check
usage (or ignore if invoked indirectly).
In /__w/lmi/lmi/gwc/allow_perf.sh line 35:
chgrp perf_users perf
^-------------------^ SC2317 (info): Command appears to be unreachable. Check
usage (or ignore if invoked indirectly).
In /__w/lmi/lmi/gwc/allow_perf.sh line 36:
chmod o-rwx perf
^--------------^ SC2317 (info): Command appears to be unreachable. Check usage
(or ignore if invoked indirectly).
In /__w/lmi/lmi/gwc/allow_perf.sh line 37:
ls -l perf
^--------^ SC2317 (info): Command appears to be unreachable. Check usage (or
ignore if invoked indirectly).
In /__w/lmi/lmi/gwc/allow_perf.sh line 42:
setcap "38,cap_ipc_lock,cap_sys_ptrace,cap_syslog=ep" perf
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if
invoked indirectly).
In /__w/lmi/lmi/gwc/allow_perf.sh line 43:
setcap -v "38,cap_ipc_lock,cap_sys_ptrace,cap_syslog=ep" perf
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if
invoked indirectly).
In /__w/lmi/lmi/gwc/allow_perf.sh line 44:
getcap perf
^---------^ SC2317 (info): Command appears to be unreachable. Check usage (or
ignore if invoked indirectly).
In /__w/lmi/lmi/gwc/allow_perf.sh line 46:
echo "usermod -aG perf_users SomeUserName"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if
invoked indirectly).
In /__w/lmi/lmi/gwc/allow_perf.sh line 55:
echo 1 >/proc/sys/kernel/perf_event_paranoid
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if
invoked indirectly).
For more information:
https://www.shellcheck.net/wiki/SC2317 -- Command appears to be unreachable...
In /__w/lmi/lmi/install_xml_libraries.sh line 260:
exit $err
^--^ SC2086 (info): Double quote to prevent globbing and word
splitting.
Did you mean:
exit "$err"
In /__w/lmi/lmi/install_xml_libraries.sh line 316:
exit $err
^--^ SC2086 (info): Double quote to prevent globbing and word
splitting.
Did you mean:
exit "$err"
For more information:
https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
make: *** [GNUmakefile:480: check_concinnity] Error 123
##[error]Process completed with exit code 2.
---------------------------------- >8 --------------------------------------
I can fix the warnings in install_xml_libraries.sh easily enough myself,
of course (the only surprising thing here is that these warnings were not
given by the previous shellcheck version), but I'm not sure what would you
like to do about those in your allow_perf.sh script? The problem is clear
enough there too, it's the "exit 9" line in the beginning, and while I see
a few different ways to work around its presence, personally I would just
remove it. However you probably didn't add it without a reason, so I'd
rather not make a patch removing it as you probably won't want to apply it.
Could you please fix this in some other way or let me know how would you
prefer me to fix it?
Thanks in advance,
VZ
pgpcLq7WiDFyG.pgp
Description: PGP signature
- [lmi] New shellcheck 0.9 warnings,
Vadim Zeitlin <=