summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2022-03-26 12:40:31 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2022-04-01 12:11:14 +0200
commitf0227a5d4c0a2576348417c658ee93bfa19dc6a0 (patch)
tree3816fd2ad7c3a32dc4b54b9dd8e31338e1cf2848
parent7e339dce78e6d00346999c9cf730bd9b1cb75837 (diff)
Use extra-environment to point to dpkg/dak sources
The hack is 7 years by now, so in an attempt to make that slightly cleaner lets move this to proper variables that can be assigned via an extra-environment file sources by the framework rather than relying on my user name and locate in public. Gbp-Dch: Ignore
-rwxr-xr-xtest/integration/test-apt-tagfile-fields-order51
1 files changed, 26 insertions, 25 deletions
diff --git a/test/integration/test-apt-tagfile-fields-order b/test/integration/test-apt-tagfile-fields-order
index 3ee0ad975..804d49c86 100755
--- a/test/integration/test-apt-tagfile-fields-order
+++ b/test/integration/test-apt-tagfile-fields-order
@@ -59,30 +59,31 @@ msgtest 'Check that apt knows all fields dpkg orders in' 'dsc'
dpkg_field_ordered_list 'CTRL_PKG_SRC' > dpkg.lst
comparelsts
-# HACK, but there is no good way to acquire sources in tests and/or to remember to run this regular manually
-if [ "$USER" = 'david' ]; then
- msgtest 'Check if we have somewhere the sources of' 'dpkg'
- DPKGSOURCE="$(locate dpkg/lib/dpkg/parse.c | head -n 1 || true)"
- if [ -z "$DPKGSOURCE" ]; then
- msgskip 'Not found'
- else
- 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 > apt.lst
- comparelsts
- fi
+DPKG_SOURCE_PARSE_C="${DPKG_SOURCE_DIRECTORY}/lib/dpkg/parse.c"
+msgtest 'Compare our knowledge with the source code of' 'dpkg'
+if [ -z "$DPKG_SOURCE_DIRECTORY" ]; then
+ msgskip 'source not provided'
+elif [ ! -r "$DPKG_SOURCE_PARSE_C" ]; then
+ msgfail 'source not found'
+else
+ msgpass
+ msgtest 'Check that apt knows about all fields' 'dpkg parses'
+ sed -n 's#^.*FIELD("\(.*\)").*$#\1#p' "${DPKG_SOURCE_PARSE_C}" | sort -u > dpkg.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
- msgtest 'Check if we have somewhere the sources of' 'dak'
- DAKSOURCE="$(locate dak/setup/core-init.d/080_metadatakeys | head -n 1 || true)"
- if [ -z "$DAKSOURCE" ]; then
- msgskip 'Not found'
- else
- msgpass
- msgtest 'Check that apt knows about all fields' 'dak knows'
- # dak mixes both, so we can only check with the mixed one as well
- sed -ne "s#^.* VALUES ('\(.*\)', \(.*\)).*\$#\1 \2#p" "${DAKSOURCE}" | cut -d ' ' -f 1 | sort -u > dpkg.lst
- sed -ne 's#^ "\(.*\)",.*$#\1#p' "${SOURCEDIRECTORY}/apt-pkg/tagfile-order.c" | sort -u > apt.lst
- comparelsts
- fi
+DAK_SOURCE_METADATAKEYS="${DAK_SOURCE_DIRECTORY}/setup/core-init.d/080_metadatakeys"
+msgtest 'Compare our knowledge with the source code of' 'dak'
+if [ -z "$DAK_SOURCE_DIRECTORY" ]; then
+ msgskip 'source not provided'
+elif [ ! -r "$DAK_SOURCE_METADATAKEYS" ]; then
+ msgfail 'source not found'
+else
+ msgpass
+ msgtest 'Check that apt knows about all fields' 'dak knows'
+ # dak mixes both, so we can only check with the mixed one as well
+ sed -ne "s#^.* VALUES ('\(.*\)', \(.*\)).*\$#\1 \2#p" "${DAK_SOURCE_METADATAKEYS}" | cut -d ' ' -f 1 | sort -u > dpkg.lst
+ sed -ne 's#^ "\(.*\)",.*$#\1#p' "${SOURCEDIRECTORY}/apt-pkg/tagfile-order.c" | sort -u > apt.lst
+ comparelsts
fi