]> The Tcpdump Group git mirrors - tcpdump/commitdiff
CI: Switch from bash to POSIX shell.
authorDenis Ovsienko <[email protected]>
Mon, 5 Jul 2021 10:59:03 +0000 (11:59 +0100)
committerDenis Ovsienko <[email protected]>
Sat, 10 Jul 2021 13:00:28 +0000 (14:00 +0100)
Same as in libpcap.

(cherry picked from commit 63ea6b5d479c70a8bfb15052885d08483a29d217)

.cirrus.yml
build.sh
build_matrix.sh

index c5072fb5c363c07b204f303f1a4ea8d26f99417a..e84047805ba943ee95670f49c35d2e2034ab60bc 100644 (file)
@@ -24,7 +24,7 @@ freebsd_task:
     MATRIX_CC: clang gcc10
   script:
     - pkg install -qy git autoconf gcc10
     MATRIX_CC: clang gcc10
   script:
     - pkg install -qy git autoconf gcc10
-    - pkg install -qy bash cmake # for build_matrix.sh and build.sh
+    - pkg install -qy cmake # for build_matrix.sh and build.sh
     - pkg install -qy pkgconf # for cmake, replaces pkg-config
     - echo '$ git clone [...] libpcap.git'
     - git -C .. clone --depth ${CIRRUS_CLONE_DEPTH} --branch=master --quiet ${LIBPCAP_GIT}
     - pkg install -qy pkgconf # for cmake, replaces pkg-config
     - echo '$ git clone [...] libpcap.git'
     - git -C .. clone --depth ${CIRRUS_CLONE_DEPTH} --branch=master --quiet ${LIBPCAP_GIT}
index 5d3592edaf54c49b292875f282211cf690aff079..4fe1ef0fc2fef0c0a32448e165b16cfae2ed7ec2 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -1,11 +1,9 @@
-#!/usr/bin/env bash
+#!/bin/sh -e
 
 # This script runs one build with setup environment variables: BUILD_LIBPCAP,
 # REMOTE, CC, CMAKE, CRYPTO and SMB
 # (default: BUILD_LIBPCAP=no, REMOTE=no, CC=gcc, CMAKE=no, CRYPTO=no, SMB=no).
 
 
 # This script runs one build with setup environment variables: BUILD_LIBPCAP,
 # REMOTE, CC, CMAKE, CRYPTO and SMB
 # (default: BUILD_LIBPCAP=no, REMOTE=no, CC=gcc, CMAKE=no, CRYPTO=no, SMB=no).
 
-set -e
-
 # BUILD_LIBPCAP: no or yes
 BUILD_LIBPCAP=${BUILD_LIBPCAP:-no}
 # REMOTE: no or yes
 # BUILD_LIBPCAP: no or yes
 BUILD_LIBPCAP=${BUILD_LIBPCAP:-no}
 # REMOTE: no or yes
@@ -30,16 +28,16 @@ fi
 export TCPDUMP_BIN="$PREFIX/bin/tcpdump"
 
 travis_fold() {
 export TCPDUMP_BIN="$PREFIX/bin/tcpdump"
 
 travis_fold() {
-    local action=${1:?}
-    local name=${2:?}
+    tf_action=${1:?}
+    tf_name=${2:?}
     if [ "$TRAVIS" != true ]; then return; fi
     if [ "$TRAVIS" != true ]; then return; fi
-    echo -ne "travis_fold:$action:$LABEL.script.$name\\r"
+    printf 'travis_fold:%s:%s.script.%s\r' "$tf_action" "$LABEL" "$tf_name"
     sleep 1
 }
 
 # Run a command after displaying it
 run_after_echo() {
     sleep 1
 }
 
 # Run a command after displaying it
 run_after_echo() {
-    echo -n '$ '
+    printf '$ '
     echo "$@"
     # shellcheck disable=SC2068
     $@
     echo "$@"
     # shellcheck disable=SC2068
     $@
index c00a39df8cede900a177d21c6ffcde4a66e491f2..08fa3eb64618baa246aad040d0a2848e0d9884e1 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh -e
 
 # This script executes the matrix loops, exclude tests and cleaning.
 # It calls the build.sh script which runs one build with setup environment
 
 # This script executes the matrix loops, exclude tests and cleaning.
 # It calls the build.sh script which runs one build with setup environment
 # MATRIX_CC='gcc clang', MATRIX_CMAKE='no yes', MATRIX_CRYPTO='no yes',
 # MATRIX_SMB='no yes').
 
 # MATRIX_CC='gcc clang', MATRIX_CMAKE='no yes', MATRIX_CRYPTO='no yes',
 # MATRIX_SMB='no yes').
 
-set -e
-
-# ANSI color escape sequences
-ANSI_MAGENTA="\\033[35;1m"
-ANSI_RESET="\\033[0m"
 uname -a
 date
 # Install directory prefix
 uname -a
 date
 # Install directory prefix
@@ -27,18 +22,18 @@ fi
 COUNT=0
 
 travis_fold() {
 COUNT=0
 
 travis_fold() {
-    local action=${1:?}
-    local name=${2:?}
+    tf_action=${1:?}
+    tf_name=${2:?}
     if [ "$TRAVIS" != true ]; then return; fi
     if [ "$TRAVIS" != true ]; then return; fi
-    echo -ne "travis_fold:$action:$LABEL.script.$name\\r"
+    printf 'travis_fold:%s:%s.script.%s\r' "$tf_action" "$LABEL" "$tf_name"
     sleep 1
 }
 
 # Display text in magenta
 echo_magenta() {
     sleep 1
 }
 
 # Display text in magenta
 echo_magenta() {
-    echo -ne "$ANSI_MAGENTA"
+    printf '\033[35;1m' # ANSI magenta
     echo "$@"
     echo "$@"
-    echo -ne "$ANSI_RESET"
+    printf '\033[0m' # ANSI reset
 }
 
 build_tcpdump() {
 }
 
 build_tcpdump() {