]> The Tcpdump Group git mirrors - tcpdump/commitdiff
CI: Apply more cleanups. [skip appveyor]
authorDenis Ovsienko <[email protected]>
Sun, 21 Mar 2021 12:18:35 +0000 (12:18 +0000)
committerDenis Ovsienko <[email protected]>
Sun, 21 Mar 2021 12:18:35 +0000 (12:18 +0000)
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.

.cirrus.yml
.travis.yml
build_matrix.sh

index 97af62b4d6a6e1896ff9714ba71a0d52f53febad..949c4716f2c105c6c87989945c8dfa7003a57d12 100644 (file)
@@ -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:
index 73d902ea663e1f4dd690a4f3743912f48dc89a6e..e9e6803926fcaf266e866b9ab632bf9e494d0de6 100644 (file)
@@ -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
index 44cd06ff5172e50095e9ac6d804475799f93f3ee..63d01f736051335cdd695d7aafa1ce027645a7f1 100755 (executable)
@@ -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