Skip to content

Commit 5abb304

Browse files
committed
CI: Disable shellcheck SC2006 in the Makefile. [skip ci]
Same as in tcpslice.
1 parent d17c816 commit 5abb304

File tree

4 files changed

+3
-18
lines changed

4 files changed

+3
-18
lines changed

Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,4 +840,4 @@ depend: $(GENERATED_C_SRC) $(GENHDR)
840840
(cd testprogs; $(MAKE) depend)
841841

842842
shellcheck:
843-
shellcheck -f gcc build.sh build_matrix.sh build_common.sh
843+
shellcheck -f gcc -e SC2006 build.sh build_matrix.sh build_common.sh

build.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
. ./build_common.sh
1212
# Install directory prefix
1313
if [ -z "$PREFIX" ]; then
14-
# shellcheck disable=SC2006
1514
PREFIX=`mktempdir libpcap_build`
1615
echo "PREFIX set to '$PREFIX'"
1716
DELETE_PREFIX=yes
@@ -23,7 +22,7 @@ print_cc_version
2322
# are not warning-free for one or another reason. If you manage to fix one of
2423
# these cases, please remember to remove respective exemption below to help any
2524
# later warnings in the same matrix subset trigger an error.
26-
# shellcheck disable=SC2006,SC2221,SC2222
25+
# shellcheck disable=SC2221,SC2222
2726
case `cc_id`/`os_id` in
2827
gcc-*/Linux-*)
2928
# This warning is a bit odd. It is steadily present in Cirrus CI, but not
@@ -80,7 +79,6 @@ suncc-5.1[45]/SunOS-5.11)
8079
LIBPCAP_TAINTED=yes
8180
;;
8281
esac
83-
# shellcheck disable=SC2006
8482
[ "$LIBPCAP_TAINTED" != yes ] && CFLAGS=`cc_werr_cflags`
8583

8684
if [ "$CMAKE" = no ]; then

build_common.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
# To make CI scripts maintenance simpler, copies of this file in the
55
# libpcap, tcpdump and tcpslice git repositories should be identical.
66
# Please mind that Solaris /bin/sh before 11 does not support the $()
7-
# command substitution syntax, hence the SC2006 directives.
7+
# command substitution syntax, hence the "-e SC2006" flag in Makefile.
88

99
# A poor man's mktemp(1) for OSes that don't have one (e.g. AIX 7, Solaris 9).
1010
mktempdir_diy() {
1111
while true; do
1212
# /bin/sh implements $RANDOM in AIX 7, but not in Solaris before 11,
1313
# thus use dd and od instead.
14-
# shellcheck disable=SC2006
1514
mktempdir_diy_suffix=`dd if=/dev/urandom bs=4 count=1 2>/dev/null | od -t x -A n | head -1 | tr -d '\t '`
1615
[ -z "$mktempdir_diy_suffix" ] && return 1
1716
mktempdir_diy_path="${TMPDIR:-/tmp}/${1:?}.${mktempdir_diy_suffix}"
@@ -29,7 +28,6 @@ mktempdir_diy() {
2928

3029
mktempdir() {
3130
mktempdir_prefix=${1:-tmp}
32-
# shellcheck disable=SC2006
3331
case `os_id` in
3432
Darwin-*|FreeBSD-*|NetBSD-*)
3533
# In these operating systems mktemp(1) always appends an implicit
@@ -61,7 +59,6 @@ print_sysinfo() {
6159

6260
# Try to make the current C compiler print its version information (usually
6361
# multi-line) to stdout.
64-
# shellcheck disable=SC2006
6562
cc_version_nocache() {
6663
: "${CC:?}"
6764
case `basename "$CC"` in
@@ -103,7 +100,6 @@ cc_version_nocache() {
103100
esac
104101
}
105102

106-
# shellcheck disable=SC2006
107103
cc_version() {
108104
echo "${cc_version_cached:=`cc_version_nocache`}"
109105
}
@@ -116,7 +112,6 @@ print_cc_version() {
116112

117113
# For the current C compiler try to print a short and uniform identification
118114
# string (such as "gcc-9.3.0") that is convenient to use in a case statement.
119-
# shellcheck disable=SC2006
120115
cc_id_nocache() {
121116
cc_id_firstline=`cc_version | head -1`
122117
: "${cc_id_firstline:?}"
@@ -161,7 +156,6 @@ cc_id_nocache() {
161156
fi
162157
}
163158

164-
# shellcheck disable=SC2006
165159
cc_id() {
166160
echo "${cc_id_cached:=`cc_id_nocache`}"
167161
}
@@ -174,7 +168,6 @@ discard_cc_cache() {
174168

175169
# For the current C compiler try to print CFLAGS value that tells to treat
176170
# warnings as errors.
177-
# shellcheck disable=SC2006
178171
cc_werr_cflags() {
179172
case `cc_id` in
180173
gcc-*|clang-*)
@@ -192,7 +185,6 @@ cc_werr_cflags() {
192185
}
193186

194187
# Tell whether "gcc" is a symlink to Clang (this is the case on macOS).
195-
# shellcheck disable=SC2006
196188
gcc_is_clang_in_disguise() {
197189
case `cc_id`/`basename "${CC:?}"` in
198190
clang-*/gcc)
@@ -202,7 +194,6 @@ gcc_is_clang_in_disguise() {
202194
return 1
203195
}
204196

205-
# shellcheck disable=SC2006
206197
os_id() {
207198
# OS does not change between builds or in the middle of a build, so it is
208199
# fine to cache uname output.
@@ -246,7 +237,6 @@ run_after_echo() {
246237
}
247238

248239
print_so_deps() {
249-
# shellcheck disable=SC2006
250240
case `os_id` in
251241
Darwin-*)
252242
run_after_echo otool -L "${1:?}"
@@ -271,7 +261,6 @@ handle_matrix_debug() {
271261
}
272262

273263
purge_directory() {
274-
# shellcheck disable=SC2006
275264
if [ "`os_id`" = SunOS-5.11 ]; then
276265
# In Solaris 11 /bin/sh the pathname expansion of "*" always includes
277266
# "." and "..", so the straightforward rm would always fail.

build_matrix.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
print_sysinfo
2323
# Install directory prefix
2424
if [ -z "$PREFIX" ]; then
25-
# shellcheck disable=SC2006
2625
PREFIX=`mktempdir libpcap_build_matrix`
2726
echo "PREFIX set to '$PREFIX'"
2827
export PREFIX
@@ -42,7 +41,6 @@ for CC in $MATRIX_CC; do
4241
export CMAKE
4342
for REMOTE in $MATRIX_REMOTE; do
4443
export REMOTE
45-
# shellcheck disable=SC2006
4644
COUNT=`increment $COUNT`
4745
echo_magenta "===== SETUP $COUNT: CC=$CC CMAKE=$CMAKE REMOTE=$REMOTE =====" >&2
4846
# Run one build with setup environment variables: CC, CMAKE and REMOTE

0 commit comments

Comments
 (0)