]> The Tcpdump Group git mirrors - libpcap/commitdiff
CI: Disable shellcheck SC2006 in the Makefile. [skip ci]
authorDenis Ovsienko <[email protected]>
Mon, 3 Jan 2022 23:44:17 +0000 (23:44 +0000)
committerGuy Harris <[email protected]>
Sun, 20 Feb 2022 23:48:19 +0000 (15:48 -0800)
Same as in tcpslice.

(cherry picked from commit 5abb30420116fcc403d8db1cafbec16f1f1a7f01)

Makefile.in
build.sh
build_common.sh
build_matrix.sh

index 74fb8f1d57fb29b4cca14592d9aa1afb3743b724..be7b9865697c87531ebd8ecbd66d766340deeff5 100644 (file)
@@ -840,4 +840,4 @@ depend:     $(GENERATED_C_SRC) $(GENHDR)
        (cd testprogs; $(MAKE) depend)
 
 shellcheck:
-       shellcheck -f gcc build.sh build_matrix.sh build_common.sh
+       shellcheck -f gcc -e SC2006 build.sh build_matrix.sh build_common.sh
index 9dd3066a622f82debb22fe882ed24b71a47a2a20..9d78f0c4ece2f459528d716783cd5d80cf702304 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -11,7 +11,6 @@
 . ./build_common.sh
 # Install directory prefix
 if [ -z "$PREFIX" ]; then
-    # shellcheck disable=SC2006
     PREFIX=`mktempdir libpcap_build`
     echo "PREFIX set to '$PREFIX'"
     DELETE_PREFIX=yes
@@ -23,7 +22,7 @@ print_cc_version
 # are not warning-free for one or another reason.  If you manage to fix one of
 # these cases, please remember to remove respective exemption below to help any
 # later warnings in the same matrix subset trigger an error.
-# shellcheck disable=SC2006,SC2221,SC2222
+# shellcheck disable=SC2221,SC2222
 case `cc_id`/`os_id` in
 gcc-*/Linux-*)
     # 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)
     LIBPCAP_TAINTED=yes
     ;;
 esac
-# shellcheck disable=SC2006
 [ "$LIBPCAP_TAINTED" != yes ] && CFLAGS=`cc_werr_cflags`
 
 if [ "$CMAKE" = no ]; then
index 0277614871b3472c903fc785e5e89c7bd6fa94c8..f65e62093f8d26bb68ac164d1f053f2af17a3869 100644 (file)
@@ -4,14 +4,13 @@
 # To make CI scripts maintenance simpler, copies of this file in the
 # libpcap, tcpdump and tcpslice git repositories should be identical.
 # Please mind that Solaris /bin/sh before 11 does not support the $()
-# command substitution syntax, hence the SC2006 directives.
+# command substitution syntax, hence the "-e SC2006" flag in Makefile.
 
 # A poor man's mktemp(1) for OSes that don't have one (e.g. AIX 7, Solaris 9).
 mktempdir_diy() {
     while true; do
         # /bin/sh implements $RANDOM in AIX 7, but not in Solaris before 11,
         # thus use dd and od instead.
-        # shellcheck disable=SC2006
         mktempdir_diy_suffix=`dd if=/dev/urandom bs=4 count=1 2>/dev/null | od -t x -A n | head -1 | tr -d '\t '`
         [ -z "$mktempdir_diy_suffix" ] && return 1
         mktempdir_diy_path="${TMPDIR:-/tmp}/${1:?}.${mktempdir_diy_suffix}"
@@ -29,7 +28,6 @@ mktempdir_diy() {
 
 mktempdir() {
     mktempdir_prefix=${1:-tmp}
-    # shellcheck disable=SC2006
     case `os_id` in
     Darwin-*|FreeBSD-*|NetBSD-*)
         # In these operating systems mktemp(1) always appends an implicit
@@ -61,7 +59,6 @@ print_sysinfo() {
 
 # Try to make the current C compiler print its version information (usually
 # multi-line) to stdout.
-# shellcheck disable=SC2006
 cc_version_nocache() {
     : "${CC:?}"
     case `basename "$CC"` in
@@ -103,7 +100,6 @@ cc_version_nocache() {
     esac
 }
 
-# shellcheck disable=SC2006
 cc_version() {
     echo "${cc_version_cached:=`cc_version_nocache`}"
 }
@@ -116,7 +112,6 @@ print_cc_version() {
 
 # For the current C compiler try to print a short and uniform identification
 # string (such as "gcc-9.3.0") that is convenient to use in a case statement.
-# shellcheck disable=SC2006
 cc_id_nocache() {
     cc_id_firstline=`cc_version | head -1`
     : "${cc_id_firstline:?}"
@@ -161,7 +156,6 @@ cc_id_nocache() {
     fi
 }
 
-# shellcheck disable=SC2006
 cc_id() {
     echo "${cc_id_cached:=`cc_id_nocache`}"
 }
@@ -174,7 +168,6 @@ discard_cc_cache() {
 
 # For the current C compiler try to print CFLAGS value that tells to treat
 # warnings as errors.
-# shellcheck disable=SC2006
 cc_werr_cflags() {
     case `cc_id` in
     gcc-*|clang-*)
@@ -192,7 +185,6 @@ cc_werr_cflags() {
 }
 
 # Tell whether "gcc" is a symlink to Clang (this is the case on macOS).
-# shellcheck disable=SC2006
 gcc_is_clang_in_disguise() {
     case `cc_id`/`basename "${CC:?}"` in
     clang-*/gcc)
@@ -202,7 +194,6 @@ gcc_is_clang_in_disguise() {
     return 1
 }
 
-# shellcheck disable=SC2006
 os_id() {
     # OS does not change between builds or in the middle of a build, so it is
     # fine to cache uname output.
@@ -246,7 +237,6 @@ run_after_echo() {
 }
 
 print_so_deps() {
-    # shellcheck disable=SC2006
     case `os_id` in
     Darwin-*)
         run_after_echo otool -L "${1:?}"
@@ -271,7 +261,6 @@ handle_matrix_debug() {
 }
 
 purge_directory() {
-    # shellcheck disable=SC2006
     if [ "`os_id`" = SunOS-5.11 ]; then
         # In Solaris 11 /bin/sh the pathname expansion of "*" always includes
         # "." and "..", so the straightforward rm would always fail.
index 489f51757854583d25e057e153541f9d187bcd95..31e1564cb401e4936cc4a842fb8745eca985d734 100755 (executable)
@@ -22,7 +22,6 @@
 print_sysinfo
 # Install directory prefix
 if [ -z "$PREFIX" ]; then
-    # shellcheck disable=SC2006
     PREFIX=`mktempdir libpcap_build_matrix`
     echo "PREFIX set to '$PREFIX'"
     export PREFIX
@@ -42,7 +41,6 @@ for CC in $MATRIX_CC; do
         export CMAKE
         for REMOTE in $MATRIX_REMOTE; do
             export REMOTE
-            # shellcheck disable=SC2006
             COUNT=`increment $COUNT`
             echo_magenta "===== SETUP $COUNT: CC=$CC CMAKE=$CMAKE REMOTE=$REMOTE =====" >&2
             # Run one build with setup environment variables: CC, CMAKE and REMOTE