summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/deblistparser.cc6
-rw-r--r--apt-pkg/deb/deblistparser.h4
-rw-r--r--apt-pkg/deb/debmetaindex.cc5
3 files changed, 15 insertions, 0 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index b62c1a84f..b98198430 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -215,6 +215,9 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver)
Ver->NextInSource = G->VersionsInSource;
G->VersionsInSource = Ver.MapPointer();
+ if (auto ArchVar = Section.Find(pkgTagSection::Key::Architecture_Variant); not ArchVar.empty())
+ Ver.ArchVariant(StoreString(pkgCacheGenerator::MIXED, ArchVar));
+
Ver->MultiArch = ParseMultiArch(true);
// Archive Size
Ver->Size = Section.FindULL(pkgTagSection::Key::Size);
@@ -1017,6 +1020,9 @@ bool debListParser::SameVersion(uint32_t Hash, /*{{{*/
unsigned char MultiArch = ParseMultiArch(false);
if (MultiArch != Ver->MultiArch)
return false;
+
+ if (ArchVariant() != Ver.ArchVariant())
+ return false;
// for all practical proposes (we can check): same version
return true;
}
diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h
index 2a9108775..7ab6800c6 100644
--- a/apt-pkg/deb/deblistparser.h
+++ b/apt-pkg/deb/deblistparser.h
@@ -99,6 +99,10 @@ class APT_HIDDEN debListParser : public pkgCacheListParser
{
return Section.Find(pkgTagSection::Key::SHA256);
}
+ std::string_view ArchVariant() const
+ {
+ return Section.Find(pkgTagSection::Key::Architecture_Variant);
+ }
#endif
};
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index c040b76b9..b85163654 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -1068,6 +1068,11 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/
auto veryforeign = _config->FindVector("APT::BarbarianArchitectures");
Values.reserve(Values.size() + veryforeign.size());
std::move(veryforeign.begin(), veryforeign.end(), std::back_inserter(Values));
+ // Let's treat architecture variants as architectures for sources.list parsing
+ auto const &variants = APT::Configuration::getArchitectureVariants(true);
+ Values.reserve(Values.size() + variants.size());
+ for (auto const &var : variants)
+ Values.push_back(var.name);
}
// all is a very special architecture users shouldn't be concerned with explicitly
// but if the user does, do not override the choice