summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2022-04-20 18:09:21 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2022-05-07 10:45:44 +0200
commit065c17440bd030341d7729c626dc732eff48ff7e (patch)
tree9b7272e68b2fe29339b0526d4a0f09f508a6ff49
parentc5b22c3dabd0cc8d0ce87576cded2594c2cd7ca1 (diff)
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.
-rwxr-xr-xprepare-release35
1 files 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.