diff options
author | David Kalnischkies <david@kalnischkies.de> | 2022-03-26 12:08:12 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2022-04-01 12:11:14 +0200 |
commit | 7e339dce78e6d00346999c9cf730bd9b1cb75837 (patch) | |
tree | 04ef4d2528f75fad3fe54e70712fe3dc81721de4 | |
parent | d1d093713afc5ea26e75abc7c7b16d4315460a4b (diff) |
Do not unique the field names in test to catch duplicates
It happens to the best, so it might happen for us, too, one day.
Better to catch it directly instead.
Gbp-Dch: Ignore
-rwxr-xr-x | test/integration/test-apt-tagfile-fields-order | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/integration/test-apt-tagfile-fields-order b/test/integration/test-apt-tagfile-fields-order index 4af58aabb..3ee0ad975 100755 --- a/test/integration/test-apt-tagfile-fields-order +++ b/test/integration/test-apt-tagfile-fields-order @@ -5,13 +5,19 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +DPKG_PERL_VERSION="$(perl -e 'use Dpkg; print "$Dpkg::PROGVERSION";')" +DPKG_OUTPUT_SORT='sort -u' +if dpkg --compare-versions "$DPKG_PERL_VERSION" '>=' '1.21.4~'; then + DPKG_OUTPUT_SORT='sort' +fi + dpkg_field_ordered_list() { local FIELDS="$(perl -e " use Dpkg::Control; use Dpkg::Control::Fields; foreach \$f (field_ordered_list(${1})) { print \"\$f\\n\"; -}" | sort -u)" +}" | $DPKG_OUTPUT_SORT )" if [ -z "$FIELDS" ]; then msgfail 'Could not get fields via libdpkg-perl' fi @@ -31,7 +37,7 @@ comparelsts() { msgtest 'Check that apt knows all fields dpkg orders in' 'Packages' dpkg_field_ordered_list 'CTRL_INDEX_PKG' > dpkg.lst -sed -ne 's#^ "\(.*\)",.*$#\1#p' "${SOURCEDIRECTORY}/apt-pkg/tagfile-order.c" | sed -n '/^Package$/,/^Package$/ p' | head -n -1 | sort -u > apt.lst +sed -ne 's#^ "\(.*\)",.*$#\1#p' "${SOURCEDIRECTORY}/apt-pkg/tagfile-order.c" | sed -n '/^Package$/,/^Package$/ p' | head -n -1 | sort > apt.lst comparelsts msgtest 'Check that apt knows all fields dpkg orders in' 'status' @@ -63,7 +69,7 @@ if [ "$USER" = 'david' ]; then msgpass msgtest 'Check that apt knows about all fields' 'dpkg parses' sed -n 's#^.*FIELD("\(.*\)").*$#\1#p' "${DPKGSOURCE}" | sort -u > dpkg.lst - sed -ne 's#^ "\(.*\)",.*$#\1#p' "${SOURCEDIRECTORY}/apt-pkg/tagfile-order.c" | sed -n '/^Package$/,/^Package$/ p' | head -n -1 | sort -u > apt.lst + sed -ne 's#^ "\(.*\)",.*$#\1#p' "${SOURCEDIRECTORY}/apt-pkg/tagfile-order.c" | sed -n '/^Package$/,/^Package$/ p' | head -n -1 | sort > apt.lst comparelsts fi |