diff options
| -rw-r--r-- | apt-pkg/acquire-item.cc | 5 | ||||
| -rwxr-xr-x | test/integration/test-architecture-variants | 12 |
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) |
