From: Denis Ovsienko Date: Sun, 21 Mar 2021 12:18:35 +0000 (+0000) Subject: CI: Apply more cleanups. [skip appveyor] X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/c30c64d0cc2aea0f155060505a607dfcf1300083 CI: Apply more cleanups. [skip appveyor] Lose travis-conditions in the Travis CI script. Simplify libpcap cloning. Dissolve choose_libpcap() as it just packed two separate single-use functions into one, also lose a temporary variable. Fixup indentation. --- diff --git a/.cirrus.yml b/.cirrus.yml index 97af62b4..949c4716 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -26,7 +26,8 @@ freebsd_task: - pkg install -qy git autoconf gcc10 - pkg install -qy bash cmake # for build_matrix.sh and build.sh - pkg install -qy pkgconf # for cmake, replaces pkg-config - - (cd .. && echo '$ git clone [...] libpcap.git' && git clone --depth ${CIRRUS_CLONE_DEPTH} --branch=master --quiet ${LIBPCAP_GIT}) + - echo '$ git clone [...] libpcap.git' + - git -C .. clone --depth ${CIRRUS_CLONE_DEPTH} --branch=master --quiet ${LIBPCAP_GIT} - ./build_matrix.sh linux_task: @@ -49,7 +50,8 @@ linux_task: - apt-get -qy install flex bison libdbus-1-dev libbluetooth-dev libnl-genl-3-dev libibverbs-dev # for libpcap - apt-get -qy install libssl-dev libsmi2-dev libcap-ng-dev libpcap-dev - apt list --installed 'lib*-dev' - - (cd .. && echo '$ git clone [...] libpcap.git' && git clone --depth ${CIRRUS_CLONE_DEPTH} --branch=master --quiet ${LIBPCAP_GIT}) + - echo '$ git clone [...] libpcap.git' + - git -C .. clone --depth ${CIRRUS_CLONE_DEPTH} --branch=master --quiet ${LIBPCAP_GIT} - ./build_matrix.sh macos_task: @@ -63,7 +65,8 @@ macos_task: script: - brew update >/dev/null - brew install libsmi | grep -v '%' - - (cd .. && echo '$ git clone [...] libpcap.git' && git clone --depth ${CIRRUS_CLONE_DEPTH} --branch=master --quiet ${LIBPCAP_GIT}) + - echo '$ git clone [...] libpcap.git' + - git -C .. clone --depth ${CIRRUS_CLONE_DEPTH} --branch=master --quiet ${LIBPCAP_GIT} - ./build_matrix.sh coverity_task: diff --git a/.travis.yml b/.travis.yml index 73d902ea..e9e68039 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ addons: - libpcap-dev script: - - gem install travis-conditions - apt list --installed 'lib*-dev' - - (cd .. && echo '$ git clone [...] libpcap.git' && git clone --depth 3 --branch=master --quiet git://github.com/the-tcpdump-group/libpcap.git) + - echo '$ git clone [...] libpcap.git' + - git -C .. clone --depth 3 --branch=master --quiet git://github.com/the-tcpdump-group/libpcap.git - ./build_matrix.sh diff --git a/build_matrix.sh b/build_matrix.sh index 44cd06ff..63d01f73 100755 --- a/build_matrix.sh +++ b/build_matrix.sh @@ -76,28 +76,15 @@ build_tcpdump() { done } -choose_libpcap() { - if [ "$BUILD_LIBPCAP" = no ]; then - echo_magenta 'Use system libpcap' - rm -rf "$PREFIX"/* - make -C ../libpcap distclean || : - else - # Build libpcap with autoconf - CMAKE_SAVE=$CMAKE - CMAKE=no - echo_magenta "Build libpcap (CMAKE=$CMAKE REMOTE=$REMOTE)" - (cd ../libpcap && ./build.sh) - CMAKE=$CMAKE_SAVE - fi -} - touch .devel configure for BUILD_LIBPCAP in ${MATRIX_BUILD_LIBPCAP:-no yes}; do -export BUILD_LIBPCAP + export BUILD_LIBPCAP if [ "$BUILD_LIBPCAP" = yes ]; then for REMOTE in ${MATRIX_REMOTE:-no}; do export REMOTE - choose_libpcap + # Build libpcap with Autoconf. + echo_magenta "Build libpcap (CMAKE=no REMOTE=$REMOTE)" + (cd ../libpcap && CMAKE=no ./build.sh) # Set PKG_CONFIG_PATH for configure when building libpcap if [ "$CMAKE" != no ]; then export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" @@ -105,7 +92,9 @@ export BUILD_LIBPCAP build_tcpdump done else - choose_libpcap + echo_magenta 'Use system libpcap' + rm -rf "$PREFIX"/* + make -C ../libpcap distclean || : build_tcpdump fi done