summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/deblistparser.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-04-05 11:58:09 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-04-05 11:58:09 +0200
commit70d761713bf1b1b4520079161708f66e8e3a4e31 (patch)
tree2467b28af8632554bc6f4ad186abe9ee0546ffa9 /apt-pkg/deb/deblistparser.cc
parent8d39b60d85b8123758f310e4a279c71879e13a06 (diff)
parent00870bf52186b5adb9819c707b411ac2fffe482b (diff)
merged from debian-sid
Diffstat (limited to 'apt-pkg/deb/deblistparser.cc')
-rw-r--r--apt-pkg/deb/deblistparser.cc35
1 files changed, 22 insertions, 13 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index edc001abb..4be626741 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)
@@ -624,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);
@@ -677,27 +685,28 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver)
}
}
- if (Ver->MultiArch == pkgCache::Version::Allowed)
+ 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)
- 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<string>::const_iterator a = Architectures.begin();
a != Architectures.end(); ++a)
{
if (NewProvides(Ver, Package, *a, Version) == false)
return false;
}
-
return true;
}
/*}}}*/