summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2018-05-28 17:02:17 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2018-05-28 17:57:25 +0200
commit484babb7d00f7550cbaa592b7cb0022d38217fad (patch)
tree94d68d28db2f4a11aa3b750d95d0ca20dc53b4e2 /test
parentc94988e75ea923afe0daae5747f974927325b186 (diff)
Don't show acquire warning for "hidden" components
Commit d7c92411dc1f4c6be098d1425f9c1c075e0c2154 introduced a warning for non-existent files from components not mentioned in Components to hint users at a mispelling or the disappearance of a component. The debian-installer subcomponent isn't actively advertised in the Release file through, so if apt ends up in acquiring a file which doesn't exist for this component (like Translation files) apt would produce a warning: W: Skipping acquire of configured file 'main/debian-installer/i18n/Translation-en' as repository 'http://deb.debian.org/debian buster InRelease' doesn't have the component 'main/debian-installer' (component misspelt in sources.list?) We prevent this in the future by checking if any file exists from this component which results in the warning to be produced still for the intended cases and silence it on the d-i case. This could potentially cause the warning not to be produced in cases it should be if some marginal file remains, but as this message is just a hint and the setup a bit pathological lets ignore it for now. There is also the possibility of having no file present as they would all be 0-length files and being a "hidden" component, but that would be easy to workaround from the repository side and isn't really actively used at the moment in the wild. Closes: #879591
Diffstat (limited to 'test')
-rw-r--r--test/integration/framework24
-rwxr-xr-xtest/integration/test-bug-879591-dont-warn-for-hidden-but-good-components25
2 files changed, 41 insertions, 8 deletions
diff --git a/test/integration/framework b/test/integration/framework
index f7c68859f..cfd621105 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -909,10 +909,17 @@ insertpackage() {
If you find such a package installed on your system,
something went horribly wrong! They are autogenerated
und used only by testcases and serve no other purposeā€¦}"
+ local SECTION="${8:-other}"
+
+ if [ "$SECTION" = "${SECTION#*/}" ]; then
+ DISTSECTION="main"
+ else
+ DISTSECTION="${SECTION%/*}"
+ fi
local ARCHS=""
for RELEASE in $(printf '%s' "$RELEASES" | tr ',' '\n'); do
if [ "$RELEASE" = 'installed' ]; then
- insertinstalledpackage "$2" "$3" "$4" "$5" "$6" "$7"
+ insertinstalledpackage "$2" "$3" "$4" "$5" "$6" "$7" "$8"
continue
fi
for arch in $(getarchitecturesfromcommalist "$ARCH"); do
@@ -922,17 +929,17 @@ insertpackage() {
ARCHS="$arch"
fi
for BUILDARCH in $ARCHS; do
- local PPATH="aptarchive/dists/${RELEASE}/main/binary-${BUILDARCH}"
+ local PPATH="aptarchive/dists/${RELEASE}/${DISTSECTION}/binary-${BUILDARCH}"
mkdir -p "$PPATH"
{
echo "Package: $NAME
Priority: $PRIORITY
-Section: other
+Section: $SECTION
Installed-Size: 42
Maintainer: Joe Sixpack <joe@example.org>"
test "$arch" = 'none' || echo "Architecture: $arch"
echo "Version: $VERSION
-Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb"
+Filename: pool/${DISTSECTION}/${NAME}/${NAME}_${VERSION}_${arch}.deb"
test -z "$DEPENDENCIES" || printf "%b\n" "$DEPENDENCIES"
echo "Description: $(printf '%s' "$DESCRIPTION" | head -n 1)"
echo "Description-md5: $(printf '%s' "$DESCRIPTION" | md5sum | cut -d' ' -f 1)"
@@ -941,12 +948,12 @@ Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb"
} >> "${PPATH}/Packages"
done
done
- mkdir -p "aptarchive/dists/${RELEASE}/main/source" "aptarchive/dists/${RELEASE}/main/i18n"
- touch "aptarchive/dists/${RELEASE}/main/source/Sources"
+ mkdir -p "aptarchive/dists/${RELEASE}/${DISTSECTION}/source" "aptarchive/dists/${RELEASE}/${DISTSECTION}/i18n"
+ touch "aptarchive/dists/${RELEASE}/${DISTSECTION}/source/Sources"
echo "Package: $NAME
Description-md5: $(printf '%s' "$DESCRIPTION" | md5sum | cut -d' ' -f 1)
Description-en: $DESCRIPTION
-" >> "aptarchive/dists/${RELEASE}/main/i18n/Translation-en"
+" >> "aptarchive/dists/${RELEASE}/${DISTSECTION}/i18n/Translation-en"
done
}
@@ -991,6 +998,7 @@ insertinstalledpackage() {
If you find such a package installed on your system,
something went horribly wrong! They are autogenerated
und used only by testcases and serve no other purposeā€¦}"
+ local SECTION="${8:-other}"
local FILE='rootdir/var/lib/dpkg/status'
local INFO='rootdir/var/lib/dpkg/info'
@@ -998,7 +1006,7 @@ insertinstalledpackage() {
echo "Package: $NAME
Status: $STATUS
Priority: $PRIORITY
-Section: other
+Section: $SECTION
Installed-Size: 42
Maintainer: Joe Sixpack <joe@example.org>
Version: $VERSION" >> "$FILE"
diff --git a/test/integration/test-bug-879591-dont-warn-for-hidden-but-good-components b/test/integration/test-bug-879591-dont-warn-for-hidden-but-good-components
new file mode 100755
index 000000000..6eb4e04a6
--- /dev/null
+++ b/test/integration/test-bug-879591-dont-warn-for-hidden-but-good-components
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'amd64'
+
+insertpackage 'stable' 'foo' 'all' '1'
+insertpackage 'stable' 'bar' 'all' '1' '' '' '' 'main/debian-installer/others'
+insertpackage 'stable-backports' 'foo' 'all' '1+sb'
+insertpackage 'stable-backports' 'bar' 'all' '1+sb' '' '' '' 'main/debian-installer/others'
+
+find aptarchive/dists -path '*/debian-installer/i18n/Translation-en*' -delete
+
+setupaptarchive --no-update
+sed -i -e '/^Codename: / a\
+Components: main contrib' $(find ./aptarchive -name 'Release')
+signreleasefiles
+
+testsuccess aptget update
+
+sed -i -e 's# main\w*$# main main/debian-installer#' rootdir/etc/apt/sources.list.d/*
+
+testsuccess aptget update