From a628ca5256b4a2f3ae300697b17adf150b6e17b0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 27 Dec 2015 17:04:33 +0100 Subject: allow repositories to forbid arch:all for specific index targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Debian has a Packages file for arch:all already, but the arch:any files contain arch:all packages as well, so downloading it would be a total waste of resources. Getting this solved is on the list of things to do, but it is also the hardest part – for index targets like Contents the situation is much easier and less server/client implementations are involved so we might not want to stall them. A repository can now declare via: No-Support-for-Architecture-all: Packages that even if an arch:all Packages exists, it shouldn't be downloaded, so that support for Contents files can be added now. See also 1dd20368486820efb6ef4476ad739e967174bec4 for the implementation of downloading arch:all index targets, which this is limiting. The field uses the name of the target from the apt configuration for simplicity and is negative by design as this field is intended to be supported/needed only for a "short" time (one or two Debian releases). While this commit theoretically supports any target, its expected to only see "Packages" as a value in reality. --- apt-pkg/metaindex.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apt-pkg/metaindex.cc') diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index fe948243e..6e5792b78 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -111,3 +111,11 @@ bool metaIndex::IsArchitectureSupported(std::string const &arch) const /*{{{*/ return true; } /*}}}*/ +bool metaIndex::IsArchitectureAllSupportedFor(IndexTarget const &target) const/*{{{*/ +{ + debReleaseIndex const * const deb = dynamic_cast(this); + if (deb != NULL) + return deb->IsArchitectureAllSupportedFor(target); + return true; +} + /*}}}*/ -- cgit v1.2.3