summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-03-28 12:29:38 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-03-28 12:29:38 +0200
commit60dcec6d513859698177c10dabfc9db184363064 (patch)
tree5ad8b1d97ddff82d96134dcaaa1e098371309f9b /apt-pkg/deb
parentede85dc09f55a50d61b96186e1f98a4f13eb57ff (diff)
* apt-pkg/deb/deblistparser.cc:
- create foo:any provides for all architectures for an allowed package
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/deblistparser.cc25
-rw-r--r--apt-pkg/deb/deblistparser.h1
2 files changed, 14 insertions, 12 deletions
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<string>::const_iterator a = Architectures.begin();
a != Architectures.end(); ++a)
{
if (NewProvides(Ver, Package, *a, Version) == false)
return false;
}
-
return true;
}
/*}}}*/
diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h
index 06ea73291..d62ce641c 100644
--- a/apt-pkg/deb/deblistparser.h
+++ b/apt-pkg/deb/deblistparser.h
@@ -40,6 +40,7 @@ class debListParser : public pkgCacheGenerator::ListParser
bool ParseDepends(pkgCache::VerIterator &Ver,const char *Tag,
unsigned int Type);
bool ParseProvides(pkgCache::VerIterator &Ver);
+ bool NewProvidesAllArch(pkgCache::VerIterator &Ver, string const &Package, string const &Version);
static bool GrabWord(string Word,WordList *List,unsigned char &Out);
public: