summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-02-12 00:04:31 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-02-12 00:04:31 +0100
commit803ea2a87f81252b2c0d541b8502ed206ce57c84 (patch)
treef6d5f02637a7bcd62330c1a51bca42a34378c0b1 /apt-pkg/pkgcachegen.cc
parentc5dac10c3dd6d8f54d97d3105803d07fa891fcd4 (diff)
Add yet another pseudo package which isn't as pseudo as the others:
Arch all packages are now represented by arch depending packages which all depend on a package with the same name and the special arch "all". This packages has NO dependencies, but beside this the same information. It is the only package which has a size, the arch depending ones all have a zero size. While the arch depending pseudo packages are used for dependency resolution the arch "all" package is used for downloading and ordering of the package.
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index ebda325f7..c1b546a00 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -115,9 +115,10 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
/* As we handle Arch all packages as architecture bounded
we add all information to every (simulated) arch package */
std::vector<string> genArch;
- if (List.ArchitectureAll() == true)
+ if (List.ArchitectureAll() == true) {
genArch = APT::Configuration::getArchitectures();
- else
+ genArch.push_back("all");
+ } else
genArch.push_back(List.Architecture());
for (std::vector<string>::const_iterator arch = genArch.begin();
@@ -531,8 +532,11 @@ bool pkgCacheGenerator::FinishCache(OpProgress &Progress) {
for (pkgCache::GrpIterator G = GetCache().GrpBegin(); G.end() != true; G++) {
string const PkgName = G.Name();
for (pkgCache::PkgIterator P = G.PackageList(); P.end() != true; P = G.NextPkg(P)) {
+ if (strcmp(P.Arch(),"all") == 0)
+ continue;
+ pkgCache::PkgIterator allPkg;
for (pkgCache::VerIterator V = P.VersionList(); V.end() != true; V++) {
- string const Arch = V.Arch();
+ string const Arch = V.Arch(true);
map_ptrloc *OldDepLast = NULL;
/* MultiArch handling introduces a lot of implicit Dependencies:
- MultiArch: same → Co-Installable if they have the same version
@@ -540,6 +544,8 @@ bool pkgCacheGenerator::FinishCache(OpProgress &Progress) {
- All others conflict with all other group members */
bool const coInstall = (V->MultiArch == pkgCache::Version::All ||
V->MultiArch == pkgCache::Version::Same);
+ if (V->MultiArch == pkgCache::Version::All && allPkg.end() == true)
+ allPkg = G.FindPkg("all");
for (vector<string>::const_iterator A = archs.begin(); A != archs.end(); ++A) {
if (*A == Arch)
continue;
@@ -561,6 +567,12 @@ bool pkgCacheGenerator::FinishCache(OpProgress &Progress) {
NewDepends(D, V, V.VerStr(),
pkgCache::Dep::Greater, pkgCache::Dep::DpkgBreaks,
OldDepLast);
+ if (V->MultiArch == pkgCache::Version::All) {
+ // Depend on ${self}:all which does depend on nothing
+ NewDepends(allPkg, V, V.VerStr(),
+ pkgCache::Dep::Equals, pkgCache::Dep::Depends,
+ OldDepLast);
+ }
} else {
// Conflicts: ${self}:other
NewDepends(D, V, "",
@@ -675,7 +687,7 @@ bool pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator Ver,
pkgCache &Cache = Owner->Cache;
// We do not add self referencing provides
- if (Ver.ParentPkg().Name() == PkgName && PkgArch == Ver.Arch())
+ if (Ver.ParentPkg().Name() == PkgName && PkgArch == Ver.Arch(true))
return true;
// Get a structure