summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2026-01-23 11:33:54 +0000
committerJulian Andres Klode <jak@debian.org>2026-01-23 11:33:54 +0000
commit8fe21178b305c31c082489c0469dbb13cf10fe49 (patch)
treed1ed8a012a19bffb4f84f30cfe1404b1a8d312da
parent9cb74f8992db1d21b091147ca3791531b3c43a73 (diff)
parent49e80c2d9061372e0ec697be43bcba4c451b7752 (diff)
Merge branch 'variants-notice' into 'main'
variants: Do not report unsupported variants in repositories See merge request apt-team/apt!546
-rw-r--r--apt-pkg/acquire-item.cc5
-rwxr-xr-xtest/integration/test-architecture-variants12
2 files changed, 11 insertions, 6 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 84f61b8bf..8bd77c052 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1703,8 +1703,9 @@ void pkgAcqMetaClearSig::QueueIndexes(bool const verify) /*{{{*/
if (TransactionManager->MetaIndexParser->IsArchitectureSupported(arch) == false)
{
new CleanupItem(Owner, TransactionManager, Target);
- _error->Notice(_("Skipping acquire of configured file '%s' as repository '%s' doesn't support architecture '%s'"),
- Target.MetaKey.c_str(), TransactionManager->Target.Description.c_str(), arch.c_str());
+ if (not std::ranges::contains(APT::Configuration::getArchitectureVariants(true), arch, [](auto v) { return v.name; }))
+ _error->Notice(_("Skipping acquire of configured file '%s' as repository '%s' doesn't support architecture '%s'"),
+ Target.MetaKey.c_str(), TransactionManager->Target.Description.c_str(), arch.c_str());
continue;
}
// if the architecture is officially supported but currently no packages for it available,
diff --git a/test/integration/test-architecture-variants b/test/integration/test-architecture-variants
index e116720c9..5883d91a2 100755
--- a/test/integration/test-architecture-variants
+++ b/test/integration/test-architecture-variants
@@ -6,15 +6,19 @@ TESTDIR="$(readlink -f "$(dirname "$0")")"
setupenvironment
configarchitecture 'amd64'
-msgmsg "Test basic ordering scenarios"
-
-echo 'APT::Architecture-Variants { "amd64v3"; "amd64v2" }' > 'rootdir/etc/apt/apt.conf.d/variants'
+# Make sure not to add v1 to the repo. We want to test that unsupported variants are silently ignored.
+echo 'APT::Architecture-Variants { "amd64v3"; "amd64v2"; "amd64v1"; }' > 'rootdir/etc/apt/apt.conf.d/variants'
insertpackage 'unstable' 'foo' 'amd64:amd64v2' '1'
insertpackage 'unstable' 'foo' 'amd64' '1'
insertpackage 'unstable' 'foo' 'amd64:amd64v3' '1'
setupaptarchive --no-update
-testsuccessequal "" aptget update -qq
+msgtest "Test that variants, particularly an unsupported amd64v1 variant does not produce a notice"
+testsuccess --nomsg apt update
+msgtest "Test that there is no unexpected output in apt-get update -qq"
+testsuccessequal --nomsg "" aptget update -qq
+
+msgmsg "Test basic ordering scenarios"
testsuccessequal "foo:
Installed: (none)