Browse Source

test: More portable check for dpkg versions

This check should work regardless if dpkg was installed by dpkg
or by a native package manager like RPM or pkg.

Gbp-Dch: ignore
tags/debian/1.3_rc3
Julian Andres Klode 5 years ago
parent
commit
03ae49aca5
4 changed files with 6 additions and 3 deletions
  1. +3
    -0
      test/integration/framework
  2. +1
    -1
      test/integration/test-bug-661537-build-profiles-support
  3. +1
    -1
      test/integration/test-bug-769609-triggers-still-pending-after-run
  4. +1
    -1
      test/integration/test-no-fds-leaked-to-maintainer-scripts

+ 3
- 0
test/integration/framework View File

@@ -195,6 +195,9 @@ aptinternalplanner() { runapt "${APTINTERNALPLANNER}" "$@"; }
dpkg() {
"${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" "$@"
}
dpkg_version() {
command perl -MDpkg -E 'say $Dpkg::PROGVERSION'
}
dpkgcheckbuilddeps() {
command dpkg-checkbuilddeps --admindir="${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg" "$@"
}


+ 1
- 1
test/integration/test-bug-661537-build-profiles-support View File

@@ -76,7 +76,7 @@ Building dependency tree...
}

msgtest 'Check if version of installed dpkg is high enough for' 'build profiles support'
if dpkg --compare-versions "$(command dpkg-query --showformat='${Version}' --show dpkg)" 'ge' '1.17.14'; then
if dpkg --compare-versions "$(dpkg_version)" 'ge' '1.17.14'; then
msgpass
testwithdpkg() {
msgtest "Test with" "dpkg-checkbuilddeps -d '$1' -P '$2'"


+ 1
- 1
test/integration/test-bug-769609-triggers-still-pending-after-run View File

@@ -8,7 +8,7 @@ setupenvironment
configarchitecture 'amd64'

msgtest 'Check if installed dpkg supports' 'noawait trigger'
if dpkg-checkbuilddeps -d 'dpkg (>= 1.16.1)' /dev/null; then
if dpkg --compare-versions "$(dpkg_version)" 'ge' '1.16.1'; then
msgpass
else
msgskip 'dpkg version too old'


+ 1
- 1
test/integration/test-no-fds-leaked-to-maintainer-scripts View File

@@ -29,7 +29,7 @@ buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
rm -rf "$BUILDDIR"

PKGNAME='fdleaks:all'
if ! dpkg-checkbuilddeps -d 'dpkg (>= 1.16.2)' /dev/null >/dev/null 2>&1; then
if dpkg --compare-versions "$(dpkg_version)" 'lt' '1.16.2'; then
PKGNAME='fdleaks'
fi



Loading…
Cancel
Save