diff options
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/acquire-item.cc | 10 | ||||
-rw-r--r-- | apt-pkg/deb/debmetaindex.cc | 13 | ||||
-rw-r--r-- | apt-pkg/deb/debmetaindex.h | 1 | ||||
-rw-r--r-- | apt-pkg/metaindex.cc | 8 | ||||
-rw-r--r-- | apt-pkg/metaindex.h | 1 |
5 files changed, 30 insertions, 3 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 7f31d1449..ffe5bd1c4 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1042,9 +1042,13 @@ void pkgAcqMetaBase::QueueIndexes(bool const verify) /*{{{*/ // download time, bandwidth and diskspace for nothing, BUT Debian doesn't feature all // in the set of supported architectures, so we can filter based on this property rather // than invent an entirely new flag we would need to carry for all of eternity. - if (Target->Option(IndexTarget::ARCHITECTURE) == "all" && - TransactionManager->MetaIndexParser->IsArchitectureSupported("all") == false) - continue; + if (Target->Option(IndexTarget::ARCHITECTURE) == "all") + { + if (TransactionManager->MetaIndexParser->IsArchitectureSupported("all") == false) + continue; + if (TransactionManager->MetaIndexParser->IsArchitectureAllSupportedFor(*Target) == false) + continue; + } bool trypdiff = Target->OptionBool(IndexTarget::PDIFFS); if (verify == true) diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index c8026aedf..46a9f9c97 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -50,6 +50,7 @@ class APT_HIDDEN debReleaseIndexPrivate /*{{{*/ time_t ValidUntilMax; std::vector<std::string> Architectures; + std::vector<std::string> NoSupportForAll; debReleaseIndexPrivate() : CheckValidUntil(metaIndex::TRI_UNSET), ValidUntilMin(0), ValidUntilMax(0) {} }; @@ -346,6 +347,11 @@ bool debReleaseIndex::Load(std::string const &Filename, std::string * const Erro if (archs.empty() == false) d->Architectures = VectorizeString(archs, ' '); } + { + std::string const targets = Section.FindS("No-Support-for-Architecture-all"); + if (targets.empty() == false) + d->NoSupportForAll = VectorizeString(targets, ' '); + } bool FoundHashSum = false; bool FoundStrongHashSum = false; @@ -624,6 +630,13 @@ bool debReleaseIndex::IsArchitectureSupported(std::string const &arch) const/*{{ return std::find(d->Architectures.begin(), d->Architectures.end(), arch) != d->Architectures.end(); } /*}}}*/ +bool debReleaseIndex::IsArchitectureAllSupportedFor(IndexTarget const &target) const/*{{{*/ +{ + if (d->NoSupportForAll.empty()) + return true; + return std::find(d->NoSupportForAll.begin(), d->NoSupportForAll.end(), target.Option(IndexTarget::CREATED_BY)) == d->NoSupportForAll.end(); +} + /*}}}*/ std::vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles() /*{{{*/ { if (Indexes != NULL) diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index 538f13f33..2bb9ed693 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -59,6 +59,7 @@ class APT_HIDDEN debReleaseIndex : public metaIndex virtual bool IsTrusted() const APT_OVERRIDE; bool IsArchitectureSupported(std::string const &arch) const; + bool IsArchitectureAllSupportedFor(IndexTarget const &target) const; void AddComponent(std::string const &sourcesEntry, bool const isSrc, std::string const &Name, 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<debReleaseIndex const *>(this); + if (deb != NULL) + return deb->IsArchitectureAllSupportedFor(target); + return true; +} + /*}}}*/ diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 3bfc2684d..3a624e86d 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -110,6 +110,7 @@ public: // FIXME: make virtual on next abi break bool IsArchitectureSupported(std::string const &arch) const; + bool IsArchitectureAllSupportedFor(IndexTarget const &target) const; }; #endif |