From 065c17440bd030341d7729c626dc732eff48ff7e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 20 Apr 2022 18:09:21 +0200 Subject: Use build-dep & satisfy for our CI dependency resolution As the name suggests the command was introduced for the travis CI which used to be based on a fixed old(er) ubuntu release. The service is no more (at least not like it was) and nowadays the command runs in unstable or equivalent environments, so can depend a bit more on apt features we have implemented years ago instead of duck tapping. --- prepare-release | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/prepare-release b/prepare-release index 5eef65276..7e417912c 100755 --- a/prepare-release +++ b/prepare-release @@ -25,29 +25,6 @@ librarysymbolsfromfile() { done | sort -u } -test_deb_control() { - echo "Package: apt-test-depends" - echo "Version: 1.0" - echo "Architecture: all" - printf "Depends:" - ( - for i in Build-Depends Build-Depends-Indep Build-Depends-Arch; do - grep-dctrl -ns $i -S apt ./debian/control && echo , - done - grep-dctrl -ns Depends -F Tests run-tests ./debian/tests/control - ) | tr '\n' ' '\ - | sed -r -e 's#<[^,<>()@]*>##g' \ - -e 's#@[^,<>()@]*@##g' \ - -e 's#\[linux-any\]*##g' \ - -e 's#\[[^][]*\]*##g' \ - -e 's#dpkg-dev \([^)]*\)#dpkg-dev#g' \ - -e 's#debhelper \([^)]*\)#debhelper#g' \ - -e 's#g\+\+ \([^)]*\)#g++#g' \ - -e 's#@##g' \ - -e 's#,(\s+,)+#, #g' \ - -e 's#\s+# #g' -} - if [ "$1" = 'pre-export' ]; then libraryversioncheck() { local LIBRARY="$1" @@ -185,11 +162,11 @@ elif [ "$1" = 'buildlog' ]; then shift done elif [ "$1" = 'travis-ci' ]; then - apt-get install -qy --no-install-recommends dctrl-tools equivs gdebi-core moreutils - - test_deb_control > test-control - equivs-build test-control - gdebi -n apt-test-depends_1.0_all.deb + apt-get build-dep -qy . + apt-get install -qy --no-install-recommends dctrl-tools + for t in $(grep '^Tests: ' debian/tests/control | cut -d':' -f 2- | tr ',' '\n'); do + apt-get satisfy -qy --no-install-recommends "base-files,$(grep-dctrl -ns Depends -F Tests $t ./debian/tests/control | sed -e 's#@[^,<>()@]*@\s*,\s*##g' -e 's#@\s*,\s*##g')" + done elif [ "$1" = 'coverage' ]; then DIR="${2:-./coverage}" git clean -dfX # remove ignored build artifacts for a clean start @@ -387,7 +364,7 @@ Both will format the diff properly. \t$0 coverage [output-dir] »travis-ci« is a shortcut to install all build- as well as test-dependencies -used by .travis.yml. +used in .gitlab-ci.yml and other CI infrastructure. »coverage« does a clean build with the right flags for coverage reporting, runs all tests and generates a html report in the end. -- cgit v1.2.3-70-g09d2