From ca238ede0446483c107ace331324cbee0f096361 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 25 Mar 2011 22:12:29 +0100 Subject: * apt-pkg/cacheiterator.h: - return "all" instead of native architecture without breaking the abi (too much) by extending enum instead of using bitflags (LP: #733741) With the next abi break that enum should be a char bitflag instead --- apt-pkg/deb/deblistparser.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index edc001abb..b79cef41c 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -106,7 +106,7 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) Ver->MultiArch = pkgCache::Version::None; else if (MultiArch == "same") { // Parse multi-arch - if (Section.FindS("Architecture") == "all") + if (ArchitectureAll() == true) { /* Arch all packages can't be Multi-Arch: same */ _error->Warning("Architecture: all package '%s' can't be Multi-Arch: same", @@ -127,6 +127,14 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) Ver->MultiArch = pkgCache::Version::None; } + if (ArchitectureAll() == true) + switch (Ver->MultiArch) + { + case pkgCache::Version::Foreign: Ver->MultiArch = pkgCache::Version::AllForeign; break; + case pkgCache::Version::Allowed: Ver->MultiArch = pkgCache::Version::AllAllowed; break; + default: Ver->MultiArch = pkgCache::Version::All; + } + // Archive Size Ver->Size = Section.FindULL("Size"); // Unpacked Size (in K) @@ -677,13 +685,13 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver) } } - if (Ver->MultiArch == pkgCache::Version::Allowed) + if (Ver->MultiArch == pkgCache::Version::Allowed || Ver->MultiArch == pkgCache::Version::AllAllowed) { string const Package = string(Ver.ParentPkg().Name()).append(":").append("any"); NewProvides(Ver, Package, "any", Ver.VerStr()); } - if (Ver->MultiArch != pkgCache::Version::Foreign) + if (Ver->MultiArch != pkgCache::Version::Foreign && Ver->MultiArch != pkgCache::Version::AllForeign) return true; if (MultiArchEnabled == false) -- cgit v1.2.3 From 60dcec6d513859698177c10dabfc9db184363064 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 28 Mar 2011 12:29:38 +0200 Subject: * apt-pkg/deb/deblistparser.cc: - create foo:any provides for all architectures for an allowed package --- apt-pkg/deb/deblistparser.cc | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index b79cef41c..4be626741 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -632,7 +632,7 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver, while (1) { - Start = ParseDepends(Start,Stop,Package,Version,Op); + Start = ParseDepends(Start,Stop,Package,Version,Op,false,!MultiArchEnabled); if (Start == 0) return _error->Error("Problem parsing dependency %s",Tag); @@ -685,27 +685,28 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver) } } - if (Ver->MultiArch == pkgCache::Version::Allowed || Ver->MultiArch == pkgCache::Version::AllAllowed) + if (MultiArchEnabled == false) + return true; + else if (Ver->MultiArch == pkgCache::Version::Allowed || Ver->MultiArch == pkgCache::Version::AllAllowed) { string const Package = string(Ver.ParentPkg().Name()).append(":").append("any"); - NewProvides(Ver, Package, "any", Ver.VerStr()); + return NewProvidesAllArch(Ver, Package, Ver.VerStr()); } + else if (Ver->MultiArch == pkgCache::Version::Foreign || Ver->MultiArch == pkgCache::Version::AllForeign) + return NewProvidesAllArch(Ver, Ver.ParentPkg().Name(), Ver.VerStr()); - if (Ver->MultiArch != pkgCache::Version::Foreign && Ver->MultiArch != pkgCache::Version::AllForeign) - return true; - - if (MultiArchEnabled == false) - return true; - - string const Package = Ver.ParentPkg().Name(); - string const Version = Ver.VerStr(); + return true; +} + /*}}}*/ +// ListParser::NewProvides - add provides for all architectures /*{{{*/ +bool debListParser::NewProvidesAllArch(pkgCache::VerIterator &Ver, string const &Package, + string const &Version) { for (std::vector::const_iterator a = Architectures.begin(); a != Architectures.end(); ++a) { if (NewProvides(Ver, Package, *a, Version) == false) return false; } - return true; } /*}}}*/ -- cgit v1.2.3