mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Format shell scripts with shfmt.
All changes in this patch were performed automatically with `shfmt` with configuration flags specified in `.pre-commit-config.yaml`. In addition to fixing whitespace the roundtrip through shfmt's AST also transforms command substitutions `cmd` # becomes $(cmd) and some redirects >&2 echo "msg" # becomes echo >&2 "msg"
This commit is contained in:
parent
e0b4659488
commit
1f388e3f40
34 changed files with 369 additions and 379 deletions
|
@ -6,3 +6,9 @@ repos:
|
||||||
rev: 'v13.0.0'
|
rev: 'v13.0.0'
|
||||||
hooks:
|
hooks:
|
||||||
- id: clang-format
|
- id: clang-format
|
||||||
|
|
||||||
|
- repo: https://github.com/maxwinterstein/shfmt-py
|
||||||
|
rev: 3.3.1.8
|
||||||
|
hooks:
|
||||||
|
- id: shfmt
|
||||||
|
args: ["-w", "-i", "4", "-ci"]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||||
. ${SCRIPT_DIR}/common.sh
|
. ${SCRIPT_DIR}/common.sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
# On Cirrus, oversubscribe the CPUs when on Linux. This uses Cirrus' "greedy" feature.
|
# On Cirrus, oversubscribe the CPUs when on Linux. This uses Cirrus' "greedy" feature.
|
||||||
if [[ "${CIRRUS_OS}" == linux ]]; then
|
if [[ "${CIRRUS_OS}" == linux ]]; then
|
||||||
if [[ -n "${ZEEK_CI_CPUS}" ]]; then
|
if [[ -n "${ZEEK_CI_CPUS}" ]]; then
|
||||||
ZEEK_CI_CPUS=$(( 2 * ${ZEEK_CI_CPUS} ))
|
ZEEK_CI_CPUS=$((2 * ${ZEEK_CI_CPUS}))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${ZEEK_CI_BTEST_JOBS}" ]]; then
|
if [[ -n "${ZEEK_CI_BTEST_JOBS}" ]]; then
|
||||||
ZEEK_CI_BTEST_JOBS=$(( 2 * ${ZEEK_CI_BTEST_JOBS} ))
|
ZEEK_CI_BTEST_JOBS=$((2 * ${ZEEK_CI_BTEST_JOBS}))
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -8,6 +8,6 @@ set -x
|
||||||
env ASSUME_ALWAYS_YES=YES pkg bootstrap
|
env ASSUME_ALWAYS_YES=YES pkg bootstrap
|
||||||
pkg install -y bash git cmake swig bison python3 base64
|
pkg install -y bash git cmake swig bison python3 base64
|
||||||
pkg upgrade -y curl
|
pkg upgrade -y curl
|
||||||
pyver=`python3 -c 'import sys; print(f"py{sys.version_info[0]}{sys.version_info[1]}")'`
|
pyver=$(python3 -c 'import sys; print(f"py{sys.version_info[0]}{sys.version_info[1]}")')
|
||||||
pkg install -y $pyver-sqlite3 $pyver-pip
|
pkg install -y $pyver-sqlite3 $pyver-pip
|
||||||
pip install junit2html
|
pip install junit2html
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
function banner
|
function banner {
|
||||||
{
|
|
||||||
local msg="${1}"
|
local msg="${1}"
|
||||||
printf "+--------------------------------------------------------------+\n"
|
printf "+--------------------------------------------------------------+\n"
|
||||||
printf "| %-60s |\n" "$(date)"
|
printf "| %-60s |\n" "$(date)"
|
||||||
printf "| %-60s |\n" "${msg}"
|
printf "| %-60s |\n" "${msg}"
|
||||||
printf "+--------------------------------------------------------------+\n"
|
printf "+--------------------------------------------------------------+\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
@ -52,8 +51,8 @@ if [[ -n "${CIRRUS_CI}" ]] && [[ "${CIRRUS_REPO_OWNER}" == "zeek" ]] && [[ ! -d
|
||||||
fi
|
fi
|
||||||
|
|
||||||
banner "Trying to clone zeek-testing-private git repo"
|
banner "Trying to clone zeek-testing-private git repo"
|
||||||
echo "${ZEEK_TESTING_PRIVATE_SSH_KEY}" > cirrus_key.b64
|
echo "${ZEEK_TESTING_PRIVATE_SSH_KEY}" >cirrus_key.b64
|
||||||
base64 -d cirrus_key.b64 > cirrus_key
|
base64 -d cirrus_key.b64 >cirrus_key
|
||||||
rm cirrus_key.b64
|
rm cirrus_key.b64
|
||||||
chmod 600 cirrus_key
|
chmod 600 cirrus_key
|
||||||
git --version
|
git --version
|
||||||
|
|
|
@ -17,8 +17,8 @@ for fuzzer_path in ${fuzzers}; do
|
||||||
|
|
||||||
if [[ -e ${corpus} ]]; then
|
if [[ -e ${corpus} ]]; then
|
||||||
echo "Fuzzer: ${fuzzer_exe} ${corpus}"
|
echo "Fuzzer: ${fuzzer_exe} ${corpus}"
|
||||||
( rm -rf corpus && mkdir corpus ) || result=1
|
(rm -rf corpus && mkdir corpus) || result=1
|
||||||
( cd corpus && unzip ../${corpus} >/dev/null ) || result=1
|
(cd corpus && unzip ../${corpus} >/dev/null) || result=1
|
||||||
${fuzzer_path} corpus/* >${fuzzer_exe}.out 2>${fuzzer_exe}.err
|
${fuzzer_path} corpus/* >${fuzzer_exe}.out 2>${fuzzer_exe}.err
|
||||||
|
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
|
@ -36,5 +36,4 @@ for fuzzer_path in ${fuzzers}; do
|
||||||
echo "-----------------------------------------"
|
echo "-----------------------------------------"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
exit ${result}
|
exit ${result}
|
||||||
|
|
43
ci/test.sh
43
ci/test.sh
|
@ -16,47 +16,41 @@ if [[ -z "${CIRRUS_CI}" ]]; then
|
||||||
ZEEK_CI_BTEST_RETRIES=2
|
ZEEK_CI_BTEST_RETRIES=2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||||
. ${SCRIPT_DIR}/common.sh
|
. ${SCRIPT_DIR}/common.sh
|
||||||
|
|
||||||
function pushd
|
function pushd {
|
||||||
{
|
command pushd "$@" >/dev/null || exit 1
|
||||||
command pushd "$@" > /dev/null || exit 1
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function popd
|
function popd {
|
||||||
{
|
command popd "$@" >/dev/null || exit 1
|
||||||
command popd "$@" > /dev/null || exit 1
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function banner
|
function banner {
|
||||||
{
|
|
||||||
local msg="${1}"
|
local msg="${1}"
|
||||||
printf "+--------------------------------------------------------------+\n"
|
printf "+--------------------------------------------------------------+\n"
|
||||||
printf "| %-60s |\n" "$(date)"
|
printf "| %-60s |\n" "$(date)"
|
||||||
printf "| %-60s |\n" "${msg}"
|
printf "| %-60s |\n" "${msg}"
|
||||||
printf "+--------------------------------------------------------------+\n"
|
printf "+--------------------------------------------------------------+\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_unit_tests
|
function run_unit_tests {
|
||||||
{
|
|
||||||
banner "Running unit tests"
|
banner "Running unit tests"
|
||||||
|
|
||||||
pushd build
|
pushd build
|
||||||
( . ./zeek-path-dev.sh && zeek --test ) || result=1
|
(. ./zeek-path-dev.sh && zeek --test) || result=1
|
||||||
popd
|
popd
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function prep_artifacts
|
function prep_artifacts {
|
||||||
{
|
|
||||||
banner "Prepare artifacts"
|
banner "Prepare artifacts"
|
||||||
[[ -d .tmp ]] && rm -rf .tmp/script-coverage && tar -czf tmp.tar.gz .tmp
|
[[ -d .tmp ]] && rm -rf .tmp/script-coverage && tar -czf tmp.tar.gz .tmp
|
||||||
junit2html btest-results.xml btest-results.html
|
junit2html btest-results.xml btest-results.html
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_btests
|
function run_btests {
|
||||||
{
|
|
||||||
banner "Running baseline tests: zeek"
|
banner "Running baseline tests: zeek"
|
||||||
|
|
||||||
pushd testing/btest
|
pushd testing/btest
|
||||||
|
@ -73,10 +67,9 @@ function run_btests
|
||||||
prep_artifacts
|
prep_artifacts
|
||||||
popd
|
popd
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_external_btests
|
function run_external_btests {
|
||||||
{
|
|
||||||
# Commenting out this line in btest.cfg causes the script profiling/coverage
|
# Commenting out this line in btest.cfg causes the script profiling/coverage
|
||||||
# to be disabled. We do this for the sanitizer build right now because of a
|
# to be disabled. We do this for the sanitizer build right now because of a
|
||||||
# fairly significant performance bug when running tests.
|
# fairly significant performance bug when running tests.
|
||||||
|
@ -120,7 +113,7 @@ function run_external_btests
|
||||||
else
|
else
|
||||||
banner "Skipping private tests (not available for PRs)"
|
banner "Skipping private tests (not available for PRs)"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
banner "Start tests: ${ZEEK_CI_CPUS} cpus, ${ZEEK_CI_BTEST_JOBS} btest jobs"
|
banner "Start tests: ${ZEEK_CI_CPUS} cpus, ${ZEEK_CI_BTEST_JOBS} btest jobs"
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
unset ZEEK_DISABLE_ZEEKYGEN;
|
unset ZEEK_DISABLE_ZEEKYGEN
|
||||||
|
|
||||||
# If running this from btest, unset any of the environment
|
# If running this from btest, unset any of the environment
|
||||||
# variables that alter default script values.
|
# variables that alter default script values.
|
||||||
unset ZEEK_DEFAULT_LISTEN_ADDRESS;
|
unset ZEEK_DEFAULT_LISTEN_ADDRESS
|
||||||
unset ZEEK_DEFAULT_LISTEN_RETRY;
|
unset ZEEK_DEFAULT_LISTEN_RETRY
|
||||||
unset ZEEK_DEFAULT_CONNECT_RETRY;
|
unset ZEEK_DEFAULT_CONNECT_RETRY
|
||||||
|
|
||||||
dir="$( cd "$( dirname "$0" )" && pwd )"
|
dir="$(cd "$(dirname "$0")" && pwd)"
|
||||||
source_dir="$( cd $dir/.. && pwd )"
|
source_dir="$(cd $dir/.. && pwd)"
|
||||||
build_dir=$source_dir/build
|
build_dir=$source_dir/build
|
||||||
conf_file=$build_dir/zeekygen-test.conf
|
conf_file=$build_dir/zeekygen-test.conf
|
||||||
output_dir=$source_dir/doc
|
output_dir=$source_dir/doc
|
||||||
|
@ -21,15 +21,14 @@ fi
|
||||||
|
|
||||||
case $output_dir in
|
case $output_dir in
|
||||||
/*) ;;
|
/*) ;;
|
||||||
*) output_dir=`pwd`/$output_dir ;;
|
*) output_dir=$(pwd)/$output_dir ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
cd $build_dir
|
cd $build_dir
|
||||||
. zeek-path-dev.sh
|
. zeek-path-dev.sh
|
||||||
export ZEEK_SEED_FILE=$source_dir/testing/btest/random.seed
|
export ZEEK_SEED_FILE=$source_dir/testing/btest/random.seed
|
||||||
|
|
||||||
function run_zeek
|
function run_zeek {
|
||||||
{
|
|
||||||
ZEEK_ALLOW_INIT_ERRORS=1 zeek -X $conf_file zeekygen >/dev/null 2>$zeek_error_file
|
ZEEK_ALLOW_INIT_ERRORS=1 zeek -X $conf_file zeekygen >/dev/null 2>$zeek_error_file
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
@ -37,23 +36,22 @@ function run_zeek
|
||||||
echo "See stderr in $zeek_error_file"
|
echo "See stderr in $zeek_error_file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
scripts_output_dir=$output_dir/scripts
|
scripts_output_dir=$output_dir/scripts
|
||||||
rm -rf $scripts_output_dir
|
rm -rf $scripts_output_dir
|
||||||
printf "script\t*\t$scripts_output_dir/" > $conf_file
|
printf "script\t*\t$scripts_output_dir/" >$conf_file
|
||||||
echo "Generating $scripts_output_dir/"
|
echo "Generating $scripts_output_dir/"
|
||||||
run_zeek
|
run_zeek
|
||||||
|
|
||||||
script_ref_dir=$output_dir/script-reference
|
script_ref_dir=$output_dir/script-reference
|
||||||
mkdir -p $script_ref_dir
|
mkdir -p $script_ref_dir
|
||||||
|
|
||||||
function generate_index
|
function generate_index {
|
||||||
{
|
|
||||||
echo "Generating $script_ref_dir/$2"
|
echo "Generating $script_ref_dir/$2"
|
||||||
printf "$1\t*\t$script_ref_dir/$2\n" > $conf_file
|
printf "$1\t*\t$script_ref_dir/$2\n" >$conf_file
|
||||||
run_zeek
|
run_zeek
|
||||||
}
|
}
|
||||||
|
|
||||||
generate_index "script_index" "autogenerated-script-index.rst"
|
generate_index "script_index" "autogenerated-script-index.rst"
|
||||||
generate_index "package_index" "autogenerated-package-index.rst"
|
generate_index "package_index" "autogenerated-package-index.rst"
|
||||||
|
|
24
configure
vendored
24
configure
vendored
|
@ -118,7 +118,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
CXXFLAGS C++ compiler flags
|
CXXFLAGS C++ compiler flags
|
||||||
"
|
"
|
||||||
|
|
||||||
sourcedir="$( cd "$( dirname "$0" )" && pwd )"
|
sourcedir="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
|
||||||
if [ ! -e "$sourcedir/cmake/COPYING" ] && [ -d "$sourcedir/.git" ]; then
|
if [ ! -e "$sourcedir/cmake/COPYING" ] && [ -d "$sourcedir/.git" ]; then
|
||||||
echo "\
|
echo "\
|
||||||
|
@ -128,8 +128,8 @@ This typically means that you performed a non-recursive git clone of
|
||||||
Zeek. To check out the required subdirectories, please execute:
|
Zeek. To check out the required subdirectories, please execute:
|
||||||
|
|
||||||
( cd $sourcedir && git submodule update --recursive --init )
|
( cd $sourcedir && git submodule update --recursive --init )
|
||||||
" >&2;
|
" >&2
|
||||||
exit 1;
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Function to append a CMake cache entry definition to the
|
# Function to append a CMake cache entry definition to the
|
||||||
|
@ -137,14 +137,14 @@ fi
|
||||||
# $1 is the cache entry variable name
|
# $1 is the cache entry variable name
|
||||||
# $2 is the cache entry variable type
|
# $2 is the cache entry variable type
|
||||||
# $3 is the cache entry variable value
|
# $3 is the cache entry variable value
|
||||||
append_cache_entry () {
|
append_cache_entry() {
|
||||||
CMakeCacheEntries="$CMakeCacheEntries -D $1:$2=$3"
|
CMakeCacheEntries="$CMakeCacheEntries -D $1:$2=$3"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to remove a CMake cache entry definition from the
|
# Function to remove a CMake cache entry definition from the
|
||||||
# CMakeCacheEntries variable
|
# CMakeCacheEntries variable
|
||||||
# $1 is the cache entry variable name
|
# $1 is the cache entry variable name
|
||||||
remove_cache_entry () {
|
remove_cache_entry() {
|
||||||
CMakeCacheEntries="$CMakeCacheEntries -U $1"
|
CMakeCacheEntries="$CMakeCacheEntries -U $1"
|
||||||
|
|
||||||
# Even with -U, cmake still warns by default if
|
# Even with -U, cmake still warns by default if
|
||||||
|
@ -179,12 +179,12 @@ has_enable_mobile_ipv6=0
|
||||||
# parse arguments
|
# parse arguments
|
||||||
while [ $# -ne 0 ]; do
|
while [ $# -ne 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
-*=*) optarg=$(echo "$1" | sed 's/[-_a-zA-Z0-9]*=//') ;;
|
||||||
*) optarg= ;;
|
*) optarg= ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--help|-h)
|
--help | -h)
|
||||||
echo "${usage}" 1>&2
|
echo "${usage}" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
@ -400,15 +400,15 @@ done
|
||||||
|
|
||||||
if [ -z "$CMakeCommand" ]; then
|
if [ -z "$CMakeCommand" ]; then
|
||||||
# prefer cmake3 over "regular" cmake (cmake == cmake2 on RHEL)
|
# prefer cmake3 over "regular" cmake (cmake == cmake2 on RHEL)
|
||||||
if command -v cmake3 >/dev/null 2>&1 ; then
|
if command -v cmake3 >/dev/null 2>&1; then
|
||||||
CMakeCommand="cmake3"
|
CMakeCommand="cmake3"
|
||||||
elif command -v cmake >/dev/null 2>&1 ; then
|
elif command -v cmake >/dev/null 2>&1; then
|
||||||
CMakeCommand="cmake"
|
CMakeCommand="cmake"
|
||||||
else
|
else
|
||||||
echo "This package requires CMake, please install it first."
|
echo "This package requires CMake, please install it first."
|
||||||
echo "Then you may use this script to configure the CMake build."
|
echo "Then you may use this script to configure the CMake build."
|
||||||
echo "Note: pass --cmake=PATH to use cmake in non-standard locations."
|
echo "Note: pass --cmake=PATH to use cmake in non-standard locations."
|
||||||
exit 1;
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -442,8 +442,8 @@ else
|
||||||
"$CMakeCommand" $CMakeCacheEntries $sourcedir
|
"$CMakeCommand" $CMakeCacheEntries $sourcedir
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "# This is the command used to configure this build" > config.status
|
echo "# This is the command used to configure this build" >config.status
|
||||||
echo $command >> config.status
|
echo $command >>config.status
|
||||||
chmod u+x config.status
|
chmod u+x config.status
|
||||||
|
|
||||||
if [ $has_enable_mobile_ipv6 -eq 1 ]; then
|
if [ $has_enable_mobile_ipv6 -eq 1 ]; then
|
||||||
|
|
|
@ -16,7 +16,7 @@ cd $test
|
||||||
grep -c '^namespace' $gen
|
grep -c '^namespace' $gen
|
||||||
mv $gen $build/
|
mv $gen $build/
|
||||||
cd $build
|
cd $build
|
||||||
ninja >& errs || echo build for $1 failed
|
ninja >&errs || echo build for $1 failed
|
||||||
|
|
||||||
export -n ZEEK_GEN_CPP
|
export -n ZEEK_GEN_CPP
|
||||||
cd $test
|
cd $test
|
||||||
|
|
|
@ -15,7 +15,7 @@ cp $build/CPP-hashes.dat .
|
||||||
grep -c '^namespace' $gen
|
grep -c '^namespace' $gen
|
||||||
mv $gen $build
|
mv $gen $build
|
||||||
cd $build
|
cd $build
|
||||||
ninja >& errs || echo build for $1 failed
|
ninja >&errs || echo build for $1 failed
|
||||||
|
|
||||||
export -n ZEEK_ADD_CPP
|
export -n ZEEK_ADD_CPP
|
||||||
cd $test
|
cd $test
|
||||||
|
|
|
@ -15,4 +15,4 @@ echo >$gen
|
||||||
grep -c '^namespace' $gen
|
grep -c '^namespace' $gen
|
||||||
mv $gen $so
|
mv $gen $so
|
||||||
cd $build
|
cd $build
|
||||||
ninja >& errs || echo test suite build failed
|
ninja >&errs || echo test suite build failed
|
||||||
|
|
|
@ -13,7 +13,7 @@ cp $build/CPP-hashes.dat .
|
||||||
grep -c '^namespace' $gen
|
grep -c '^namespace' $gen
|
||||||
mv $gen $build/
|
mv $gen $build/
|
||||||
cd $build
|
cd $build
|
||||||
ninja >& errs || echo build for $1 failed
|
ninja >&errs || echo build for $1 failed
|
||||||
|
|
||||||
export -n ZEEK_ADD_CPP
|
export -n ZEEK_ADD_CPP
|
||||||
cd $test
|
cd $test
|
||||||
|
|
|
@ -10,11 +10,10 @@
|
||||||
|
|
||||||
error_count=0
|
error_count=0
|
||||||
|
|
||||||
error_msg()
|
error_msg() {
|
||||||
{
|
error_count=$((error_count + 1))
|
||||||
error_count=$((error_count+1))
|
echo "$@" 1>&2
|
||||||
echo "$@" 1>&2;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if [ $# -ne 2 ]; then
|
if [ $# -ne 2 ]; then
|
||||||
print "incorrect arguments"
|
print "incorrect arguments"
|
||||||
|
@ -29,7 +28,7 @@ for f in $all_loads; do
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $error_count -gt 0 ]; then
|
if [ $error_count -gt 0 ]; then
|
||||||
exit 1;
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -60,4 +60,3 @@ EOF
|
||||||
cat >activate.zeek <<EOF
|
cat >activate.zeek <<EOF
|
||||||
@load-plugin Demo::Foo
|
@load-plugin Demo::Foo
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
# 4a. Analyze .gcov files generated and create summary file
|
# 4a. Analyze .gcov files generated and create summary file
|
||||||
# 4b. Send .gcov files to appropriate path
|
# 4b. Send .gcov files to appropriate path
|
||||||
#
|
#
|
||||||
CURR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Location of script
|
CURR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Location of script
|
||||||
BASE="$( cd "$CURR" && cd ../../ && pwd )"
|
BASE="$(cd "$CURR" && cd ../../ && pwd)"
|
||||||
TMP="${CURR}/tmp.$$"
|
TMP="${CURR}/tmp.$$"
|
||||||
mkdir -p $TMP
|
mkdir -p $TMP
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ function check_file_coverage {
|
||||||
|
|
||||||
# Avoid division-by-zero problems:
|
# Avoid division-by-zero problems:
|
||||||
PERCENTAGE=0.000
|
PERCENTAGE=0.000
|
||||||
[ $RUN -gt 0 ] && PERCENTAGE=$(bc <<< "scale=3; 100*$RUN/$TOTAL")
|
[ $RUN -gt 0 ] && PERCENTAGE=$(bc <<<"scale=3; 100*$RUN/$TOTAL")
|
||||||
|
|
||||||
# Find correlation between % of lines run vs. "Runs"
|
# Find correlation between % of lines run vs. "Runs"
|
||||||
echo -e "$PERCENTAGE\t$RUN\t$TOTAL\t$(grep "0:Runs" "$i" | sed 's/.*://')\t$i"
|
echo -e "$PERCENTAGE\t$RUN\t$TOTAL\t$(grep "0:Runs" "$i" | sed 's/.*://')\t$i"
|
||||||
|
@ -56,14 +56,14 @@ function check_group_coverage {
|
||||||
OUTPUT="$3"
|
OUTPUT="$3"
|
||||||
|
|
||||||
# Prints all the relevant directories
|
# Prints all the relevant directories
|
||||||
DIRS=$(for i in $(cut -f 5 "$DATA"); do basename "$i" | sed 's/#[^#]*$//'; done \
|
DIRS=$(for i in $(cut -f 5 "$DATA"); do basename "$i" | sed 's/#[^#]*$//'; done |
|
||||||
| sort | uniq | sed 's/^.*'"${SRC_FOLDER}"'//' | grep "^#s\+" )
|
sort | uniq | sed 's/^.*'"${SRC_FOLDER}"'//' | grep "^#s\+")
|
||||||
# "Generalize" folders unless it's from analyzers
|
# "Generalize" folders unless it's from analyzers
|
||||||
DIRS=$(for i in $DIRS; do
|
DIRS=$(for i in $DIRS; do
|
||||||
if !(echo "$i" | grep "src#analyzer"); then
|
if !(echo "$i" | grep "src#analyzer"); then
|
||||||
echo "$i" | cut -d "#" -f 1,2,3
|
echo "$i" | cut -d "#" -f 1,2,3
|
||||||
fi
|
fi
|
||||||
done | sort | uniq )
|
done | sort | uniq)
|
||||||
|
|
||||||
for i in $DIRS; do
|
for i in $DIRS; do
|
||||||
# For elements in #src, we only care about the files direclty in the directory.
|
# For elements in #src, we only care about the files direclty in the directory.
|
||||||
|
@ -75,9 +75,9 @@ function check_group_coverage {
|
||||||
TOTAL=$(echo $(grep "$i" $DATA | cut -f 3) | tr " " "+" | bc)
|
TOTAL=$(echo $(grep "$i" $DATA | cut -f 3) | tr " " "+" | bc)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PERCENTAGE=$( echo "scale=3;100*$RUN/$TOTAL" | bc | tr "\n" " " )
|
PERCENTAGE=$(echo "scale=3;100*$RUN/$TOTAL" | bc | tr "\n" " ")
|
||||||
printf "%-50s\t%12s\t%6s %%\n" "$i" "$RUN/$TOTAL" $PERCENTAGE \
|
printf "%-50s\t%12s\t%6s %%\n" "$i" "$RUN/$TOTAL" $PERCENTAGE |
|
||||||
| sed 's|#|/|g' >>$OUTPUT
|
sed 's|#|/|g' >>$OUTPUT
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,8 +97,8 @@ echo "ok"
|
||||||
# 3a. Run gcov (-p to preserve path) and move into tmp directory
|
# 3a. Run gcov (-p to preserve path) and move into tmp directory
|
||||||
# ... if system does not have gcov installed, exit with message.
|
# ... if system does not have gcov installed, exit with message.
|
||||||
echo -n "Creating coverage files... "
|
echo -n "Creating coverage files... "
|
||||||
if which gcov > /dev/null 2>&1; then
|
if which gcov >/dev/null 2>&1; then
|
||||||
( cd "$TMP" && find "$BASE" -name "*.o" -exec gcov -p {} > /dev/null 2>&1 \; )
|
(cd "$TMP" && find "$BASE" -name "*.o" -exec gcov -p {} \; >/dev/null 2>&1)
|
||||||
NUM_GCOVS=$(find "$TMP" -name *.gcov | wc -l)
|
NUM_GCOVS=$(find "$TMP" -name *.gcov | wc -l)
|
||||||
if [ $NUM_GCOVS -eq 0 ]; then
|
if [ $NUM_GCOVS -eq 0 ]; then
|
||||||
echo "no gcov files produced, aborting"
|
echo "no gcov files produced, aborting"
|
||||||
|
@ -108,7 +108,7 @@ if which gcov > /dev/null 2>&1; then
|
||||||
# Account for '^' that occurs in macOS due to LLVM
|
# Account for '^' that occurs in macOS due to LLVM
|
||||||
# This character seems to be equivalent to ".." (up 1 dir)
|
# This character seems to be equivalent to ".." (up 1 dir)
|
||||||
for file in $(ls $TMP/*.gcov | grep '\^'); do
|
for file in $(ls $TMP/*.gcov | grep '\^'); do
|
||||||
mv $file "$(sed 's/#[^#]*#\^//g' <<< "$file")"
|
mv $file "$(sed 's/#[^#]*#\^//g' <<<"$file")"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "ok, $NUM_GCOVS coverage files"
|
echo "ok, $NUM_GCOVS coverage files"
|
||||||
|
@ -134,7 +134,7 @@ echo "ok, $NUM_GCOVS coverage files remain"
|
||||||
echo -n "Creating summary file... "
|
echo -n "Creating summary file... "
|
||||||
DATA="${TMP}/data.txt"
|
DATA="${TMP}/data.txt"
|
||||||
SUMMARY="$CURR/coverage.log"
|
SUMMARY="$CURR/coverage.log"
|
||||||
check_file_coverage "$TMP" > "$DATA"
|
check_file_coverage "$TMP" >"$DATA"
|
||||||
check_group_coverage "$DATA" ${BASE##*/} $SUMMARY
|
check_group_coverage "$DATA" ${BASE##*/} $SUMMARY
|
||||||
echo "ok"
|
echo "ok"
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ function finish {
|
||||||
rm -rf "$TMP"
|
rm -rf "$TMP"
|
||||||
}
|
}
|
||||||
function verify_run {
|
function verify_run {
|
||||||
if bash -c "$1" > /dev/null 2>&1; then
|
if bash -c "$1" >/dev/null 2>&1; then
|
||||||
echo ${2:-"ok"}
|
echo ${2:-"ok"}
|
||||||
else
|
else
|
||||||
die ${3:-"error, abort"}
|
die ${3:-"error, abort"}
|
||||||
|
@ -50,7 +50,7 @@ Usage: $0 <options>
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
while (( "$#" )); do
|
while (("$#")); do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--html)
|
--html)
|
||||||
HTML_REPORT=1
|
HTML_REPORT=1
|
||||||
|
@ -96,7 +96,7 @@ fi
|
||||||
REMOVE_TARGETS="*.yy *.ll *.y *.l \*/bro.dir/\* *.bif \*/zeek.dir/\* \*/src/3rdparty/\* \*/src/zeek/3rdparty/\* \*/auxil/\* "
|
REMOVE_TARGETS="*.yy *.ll *.y *.l \*/bro.dir/\* *.bif \*/zeek.dir/\* \*/src/3rdparty/\* \*/src/zeek/3rdparty/\* \*/auxil/\* "
|
||||||
|
|
||||||
# 1. Move to base dir, create tmp dir
|
# 1. Move to base dir, create tmp dir
|
||||||
cd ../../;
|
cd ../../
|
||||||
mkdir "$TMP"
|
mkdir "$TMP"
|
||||||
|
|
||||||
# 2. Check for .gcno and .gcda file presence
|
# 2. Check for .gcno and .gcda file presence
|
||||||
|
|
12
testing/external/scripts/create-new-repo
vendored
12
testing/external/scripts/create-new-repo
vendored
|
@ -3,14 +3,14 @@
|
||||||
# Helper script for creating new external testing repos. See the
|
# Helper script for creating new external testing repos. See the
|
||||||
# README for details.
|
# README for details.
|
||||||
|
|
||||||
cwd=`pwd`
|
cwd=$(pwd)
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "usage: $0 <name> [<dst-repo-url>]"
|
echo "usage: $0 <name> [<dst-repo-url>]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
name=`pwd`/$1
|
name=$(pwd)/$1
|
||||||
repo=$2
|
repo=$2
|
||||||
|
|
||||||
if [ -e $name ]; then
|
if [ -e $name ]; then
|
||||||
|
@ -29,10 +29,10 @@ done
|
||||||
|
|
||||||
ln -s ../subdir-btest.cfg ./btest.cfg
|
ln -s ../subdir-btest.cfg ./btest.cfg
|
||||||
|
|
||||||
cp $cwd/`dirname $0`/skel/test.skeleton tests
|
cp $cwd/$(dirname $0)/skel/test.skeleton tests
|
||||||
cp $cwd/`dirname $0`/skel/traces.cfg .
|
cp $cwd/$(dirname $0)/skel/traces.cfg .
|
||||||
cp $cwd/`dirname $0`/skel/Makefile .
|
cp $cwd/$(dirname $0)/skel/Makefile .
|
||||||
cp $cwd/`dirname $0`/skel/.gitignore .
|
cp $cwd/$(dirname $0)/skel/.gitignore .
|
||||||
|
|
||||||
git add * .gitignore
|
git add * .gitignore
|
||||||
|
|
||||||
|
|
8
testing/external/scripts/diff-all
vendored
8
testing/external/scripts/diff-all
vendored
|
@ -16,12 +16,12 @@ else
|
||||||
rm -f $diag
|
rm -f $diag
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rc=0;
|
rc=0
|
||||||
|
|
||||||
files_cwd=`ls $@`
|
files_cwd=$(ls $@)
|
||||||
files_baseline=`cd $TEST_BASELINE && ls $@`
|
files_baseline=$(cd $TEST_BASELINE && ls $@)
|
||||||
|
|
||||||
for i in `echo $files_cwd $files_baseline | sort | uniq`; do
|
for i in $(echo $files_cwd $files_baseline | sort | uniq); do
|
||||||
if [[ "$i" != "loaded_scripts.log" && "$i" != "prof.log" && "$i" != "debug.log" && "$i" != "stats.log" && "$i" != broker_*.log ]]; then
|
if [[ "$i" != "loaded_scripts.log" && "$i" != "prof.log" && "$i" != "debug.log" && "$i" != "stats.log" && "$i" != broker_*.log ]]; then
|
||||||
|
|
||||||
if [[ "$i" == "reporter.log" ]]; then
|
if [[ "$i" == "reporter.log" ]]; then
|
||||||
|
|
2
testing/external/scripts/find-git-repos
vendored
2
testing/external/scripts/find-git-repos
vendored
|
@ -3,6 +3,6 @@
|
||||||
# Returns a list of git repositories found in subdirs of the
|
# Returns a list of git repositories found in subdirs of the
|
||||||
# current directory.
|
# current directory.
|
||||||
|
|
||||||
for i in `find . -type d`; do
|
for i in $(find . -type d); do
|
||||||
test -e $i/.git && echo $i
|
test -e $i/.git && echo $i
|
||||||
done
|
done
|
||||||
|
|
12
testing/external/scripts/update-traces
vendored
12
testing/external/scripts/update-traces
vendored
|
@ -5,7 +5,7 @@
|
||||||
# traces.cfg must consist of lines of the form "<url> [<http-user>[:<http-password>]]"
|
# traces.cfg must consist of lines of the form "<url> [<http-user>[:<http-password>]]"
|
||||||
|
|
||||||
if [ "$1" == "" ]; then
|
if [ "$1" == "" ]; then
|
||||||
echo "usage: `basename $0` <traces-directory>"
|
echo "usage: $(basename $0) <traces-directory>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ cfg=traces.cfg
|
||||||
|
|
||||||
for p in .proxy ../.proxy; do
|
for p in .proxy ../.proxy; do
|
||||||
if [ -e $p ]; then
|
if [ -e $p ]; then
|
||||||
proxy=`cat $p | head -1 | awk '{print $1}'`
|
proxy=$(cat $p | head -1 | awk '{print $1}')
|
||||||
echo Using proxy $proxy ...
|
echo Using proxy $proxy ...
|
||||||
proxy="ALL_PROXY=$proxy"
|
proxy="ALL_PROXY=$proxy"
|
||||||
break
|
break
|
||||||
|
@ -37,16 +37,16 @@ cat $cfg | while read line; do
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
url=`echo $line | awk '{print $1}'`
|
url=$(echo $line | awk '{print $1}')
|
||||||
auth=`echo $line | awk '{print $2}'`
|
auth=$(echo $line | awk '{print $2}')
|
||||||
|
|
||||||
file=$1/`echo $url | sed 's#^.*/##g'`
|
file=$1/$(echo $url | sed 's#^.*/##g')
|
||||||
fp=$file.md5sum
|
fp=$file.md5sum
|
||||||
|
|
||||||
if [ "$auth" != "" ]; then
|
if [ "$auth" != "" ]; then
|
||||||
auth="-u $auth"
|
auth="-u $auth"
|
||||||
# Hide the hostname and directory names in output messages
|
# Hide the hostname and directory names in output messages
|
||||||
safe_url=`echo $url | sed 's#/[A-Za-z].*/#/[hidden]/#'`
|
safe_url=$(echo $url | sed 's#/[A-Za-z].*/#/[hidden]/#')
|
||||||
else
|
else
|
||||||
safe_url=$url
|
safe_url=$url
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
#
|
#
|
||||||
# Default canonifier used with the tests in testing/btest/*.
|
# Default canonifier used with the tests in testing/btest/*.
|
||||||
|
|
||||||
`dirname $0`/diff-remove-timestamps
|
$(dirname $0)/diff-remove-timestamps
|
||||||
|
|
|
@ -3,28 +3,27 @@
|
||||||
# Default canonifier used with the trace-based tests in testing/external/*.
|
# Default canonifier used with the trace-based tests in testing/external/*.
|
||||||
|
|
||||||
if [ $# != 1 ]; then
|
if [ $# != 1 ]; then
|
||||||
echo "usage: `basename $0` <filename>"
|
echo "usage: $(basename $0) <filename>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
filename=`basename $1`
|
filename=$(basename $1)
|
||||||
|
|
||||||
addl="cat"
|
addl="cat"
|
||||||
|
|
||||||
if [ "$filename" == "capture_loss.log" ]; then
|
if [ "$filename" == "capture_loss.log" ]; then
|
||||||
addl="`dirname $0`/diff-remove-fractions"
|
addl="$(dirname $0)/diff-remove-fractions"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$filename" == "ssh.log" ]; then
|
if [ "$filename" == "ssh.log" ]; then
|
||||||
addl="`dirname $0`/diff-remove-fields remote_location"
|
addl="$(dirname $0)/diff-remove-fields remote_location"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
`dirname $0`/diff-remove-timestamps \
|
$(dirname $0)/diff-remove-timestamps |
|
||||||
| `dirname $0`/diff-remove-uids \
|
$(dirname $0)/diff-remove-uids |
|
||||||
| `dirname $0`/diff-remove-file-ids \
|
$(dirname $0)/diff-remove-file-ids |
|
||||||
| `dirname $0`/diff-remove-x509-names \
|
$(dirname $0)/diff-remove-x509-names |
|
||||||
| `dirname $0`/diff-sort-conn-service \
|
$(dirname $0)/diff-sort-conn-service |
|
||||||
| `dirname $0`/diff-sort-set-elements \
|
$(dirname $0)/diff-sort-set-elements |
|
||||||
| `dirname $0`/diff-sort \
|
$(dirname $0)/diff-sort |
|
||||||
| eval $addl
|
eval $addl
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
#
|
#
|
||||||
# Replace absolute paths with the basename.
|
# Replace absolute paths with the basename.
|
||||||
|
|
||||||
if [ `uname` == "Linux" ]; then
|
if [ $(uname) == "Linux" ]; then
|
||||||
sed="sed -r"
|
sed="sed -r"
|
||||||
else
|
else
|
||||||
sed="sed -E"
|
sed="sed -E"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$sed 's#/+#/#g' | \
|
$sed 's#/+#/#g' |
|
||||||
$sed 's#/([^ :/]{1,}/){1,}([^ :/]{1,})#<...>/\2#g'
|
$sed 's#/([^ :/]{1,}/){1,}([^ :/]{1,})#<...>/\2#g'
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# prefix.
|
# prefix.
|
||||||
|
|
||||||
if [ $# != 1 ]; then
|
if [ $# != 1 ]; then
|
||||||
echo "usage: `basename $0` <field prefix>"
|
echo "usage: $(basename $0) <field prefix>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -3,4 +3,3 @@
|
||||||
# Replace fractions of double value (i.e., 3.14 -> 3.x).
|
# Replace fractions of double value (i.e., 3.14 -> 3.x).
|
||||||
|
|
||||||
sed 's/\.[0-9]\{1,\}/.X/g'
|
sed 's/\.[0-9]\{1,\}/.X/g'
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Replace timestamps in the #start/end markers in logs.
|
# Replace timestamps in the #start/end markers in logs.
|
||||||
|
|
||||||
# Get us "modern" regexps with sed.
|
# Get us "modern" regexps with sed.
|
||||||
if [ `uname` == "Linux" ]; then
|
if [ $(uname) == "Linux" ]; then
|
||||||
sed="sed -r"
|
sed="sed -r"
|
||||||
else
|
else
|
||||||
sed="sed -E"
|
sed="sed -E"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Replace anything which looks like timestamps with XXXs (including the #start/end markers in logs).
|
# Replace anything which looks like timestamps with XXXs (including the #start/end markers in logs).
|
||||||
|
|
||||||
# Get us "modern" regexps with sed.
|
# Get us "modern" regexps with sed.
|
||||||
if [ `uname` == "Linux" ]; then
|
if [ $(uname) == "Linux" ]; then
|
||||||
sed="sed -r"
|
sed="sed -r"
|
||||||
else
|
else
|
||||||
sed="sed -E"
|
sed="sed -E"
|
||||||
|
|
|
@ -8,11 +8,11 @@ if [ "$TMP" == "" ]; then
|
||||||
TMP=/tmp
|
TMP=/tmp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tmp=$TMP/`basename $0`.$$.tmp
|
tmp=$TMP/$(basename $0).$$.tmp
|
||||||
|
|
||||||
cat >$tmp
|
cat >$tmp
|
||||||
|
|
||||||
echo "### NOTE: This file has been sorted with `basename $0`."
|
echo "### NOTE: This file has been sorted with $(basename $0)."
|
||||||
cat $tmp | grep ^#
|
cat $tmp | grep ^#
|
||||||
cat $tmp | grep -v ^# | sort -s
|
cat $tmp | grep -v ^# | sort -s
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
#
|
#
|
||||||
# Just writes the arguments and stdin to a file, to compare with diff
|
# Just writes the arguments and stdin to a file, to compare with diff
|
||||||
|
|
||||||
echo "------- cmdline args -----------" >> sendmail.out
|
echo "------- cmdline args -----------" >>sendmail.out
|
||||||
echo "$*" >> sendmail.out
|
echo "$*" >>sendmail.out
|
||||||
echo "----------- stdin --------------" >> sendmail.out
|
echo "----------- stdin --------------" >>sendmail.out
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
# Strip out the user agent, which is version dependent
|
# Strip out the user agent, which is version dependent
|
||||||
if [[ $line == "User-Agent: Zeek/"* ]]; then
|
if [[ $line == "User-Agent: Zeek/"* ]]; then
|
||||||
printf 'User-Agent: Zeek/$zeek_version()\n' >> sendmail.out
|
printf 'User-Agent: Zeek/$zeek_version()\n' >>sendmail.out
|
||||||
else
|
else
|
||||||
printf '%s\n' "$line" >> sendmail.out
|
printf '%s\n' "$line" >>sendmail.out
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -41,8 +41,8 @@ if [ "$file_hash" != "$head_hash" ]; then
|
||||||
read -p "[Y/n] " choice
|
read -p "[Y/n] " choice
|
||||||
|
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
n|N) echo "Skipped '$repo_base'";;
|
n | N) echo "Skipped '$repo_base'" ;;
|
||||||
*) echo $head_hash > $hash_file && git add $hash_file && echo "Updated '$file_base'";;
|
*) echo $head_hash >$hash_file && git add $hash_file && echo "Updated '$file_base'" ;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
echo " none"
|
echo " none"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Sleeps until a file comes into existence.
|
# Sleeps until a file comes into existence.
|
||||||
|
|
||||||
if [[ $# -ne 2 ]]; then
|
if [[ $# -ne 2 ]]; then
|
||||||
>&2 echo "usage: $0 <file to wait for> <max secs to wait>"
|
echo >&2 "usage: $0 <file to wait for> <max secs to wait>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -15,10 +15,9 @@ while [[ ! -e $wait_file ]]; do
|
||||||
let "wait_count += 1"
|
let "wait_count += 1"
|
||||||
|
|
||||||
if [[ $wait_count -ge $max_wait ]]; then
|
if [[ $wait_count -ge $max_wait ]]; then
|
||||||
>&2 echo "error: file '$wait_file' does not exist after $max_wait seconds"
|
echo >&2 "error: file '$wait_file' does not exist after $max_wait seconds"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -69,14 +69,14 @@ Toplevel installation directories for third-party components:
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ $# -eq 0 ] ; then
|
if [ $# -eq 0 ]; then
|
||||||
usage 1>&2
|
usage 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while [ $# -ne 0 ]; do
|
while [ $# -ne 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
-*=*) optarg=$(echo "$1" | sed 's/[-_a-zA-Z0-9]*=//') ;;
|
||||||
*) optarg= ;;
|
*) optarg= ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# exit code.
|
# exit code.
|
||||||
|
|
||||||
function deprecated {
|
function deprecated {
|
||||||
cat >&2 <<EOF
|
cat >&2 <<EOF
|
||||||
Error: Use of '$1' is no longer supported. Please use '$2' instead.
|
Error: Use of '$1' is no longer supported. Please use '$2' instead.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue