diff options
author | Denis Ovsienko <denis@ovsienko.info> | 2021-07-05 11:59:03 +0100 |
---|---|---|
committer | Denis Ovsienko <denis@ovsienko.info> | 2021-07-05 11:59:03 +0100 |
commit | 63ea6b5d479c70a8bfb15052885d08483a29d217 (patch) | |
tree | 0e5d33fa083f7e22d8c15b0d263a3c904c70e41c | |
parent | 59ddbc3fd41600c293c05cd75b3bdc80ff8eb18f (diff) | |
download | tcpdump-63ea6b5d479c70a8bfb15052885d08483a29d217.tar.gz |
CI: Switch from bash to POSIX shell.
Same as in libpcap.
-rw-r--r-- | .cirrus.yml | 2 | ||||
-rwxr-xr-x | build.sh | 12 | ||||
-rwxr-xr-x | build_matrix.sh | 17 |
3 files changed, 12 insertions, 19 deletions
diff --git a/.cirrus.yml b/.cirrus.yml index c5072fb5..e8404780 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -24,7 +24,7 @@ freebsd_task: 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} @@ -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). -set -e - # 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() { - local action=${1:?} - local name=${2:?} + tf_action=${1:?} + tf_name=${2:?} 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() { - echo -n '$ ' + printf '$ ' echo "$@" # shellcheck disable=SC2068 $@ diff --git a/build_matrix.sh b/build_matrix.sh index c00a39df..08fa3eb6 100755 --- a/build_matrix.sh +++ b/build_matrix.sh @@ -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 @@ -11,11 +11,6 @@ # 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 @@ -27,18 +22,18 @@ fi COUNT=0 travis_fold() { - local action=${1:?} - local name=${2:?} + tf_action=${1:?} + tf_name=${2:?} 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() { - echo -ne "$ANSI_MAGENTA" + printf '\033[35;1m' # ANSI magenta echo "$@" - echo -ne "$ANSI_RESET" + printf '\033[0m' # ANSI reset } build_tcpdump() { |