summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-02-12 17:17:16 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-02-12 17:17:16 +0100
commit42d71ab5fe58953a680bd300a99d173e23430d7c (patch)
treed79a294141757a8bc9207bd44fa53cfa13ac006a
parent803ea2a87f81252b2c0d541b8502ed206ce57c84 (diff)
In SingleArch environments we don't need the arch "all" pseudo package
for handling arch:all packages, so we create only one package and stop calling it a pseudo package.
-rw-r--r--apt-pkg/deb/deblistparser.cc2
-rw-r--r--apt-pkg/pkgcache.cc9
-rw-r--r--apt-pkg/pkgcachegen.cc3
-rw-r--r--cmdline/apt-get.cc3
4 files changed, 13 insertions, 4 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index b3d95164a..1948aedf3 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -158,7 +158,7 @@ bool debListParser::NewVersion(pkgCache::VerIterator Ver)
the architecture bound versions coming in and out on regular basis. */
if (strcmp(Ver.Arch(true),"all") == 0)
return true;
- else
+ else if (Ver.Pseudo() == true)
{
// our pseudo packages have no size to not confuse the fetcher
Ver->Size = 0;
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 04a2c7234..d4268b31c 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -657,8 +657,13 @@ bool pkgCache::VerIterator::Automatic() const
are a problem everytime we need to download/install something. */
bool pkgCache::VerIterator::Pseudo() const
{
- return (S->MultiArch == pkgCache::Version::All &&
- strcmp(Arch(true),"all") != 0);
+ if (S->MultiArch == pkgCache::Version::All &&
+ strcmp(Arch(true),"all") != 0)
+ {
+ GrpIterator const Grp = ParentPkg().Group();
+ return (Grp->LastPackage != Grp->FirstPackage);
+ }
+ return false;
}
/*}}}*/
// VerIterator::NewestFile - Return the newest file version relation /*{{{*/
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index c1b546a00..6d103c6b6 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -117,7 +117,8 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
std::vector<string> genArch;
if (List.ArchitectureAll() == true) {
genArch = APT::Configuration::getArchitectures();
- genArch.push_back("all");
+ if (genArch.size() != 1)
+ genArch.push_back("all");
} else
genArch.push_back(List.Architecture());
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 93065004c..343226bc3 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -585,6 +585,9 @@ void Stats(ostream &out,pkgDepCache &Dep)
unsigned long ReInstall = 0;
for (pkgCache::PkgIterator I = Dep.PkgBegin(); I.end() == false; I++)
{
+ if (pkgCache::VerIterator(Dep, Dep[I].CandidateVer).Pseudo() == true)
+ continue;
+
if (Dep[I].NewInstall() == true)
Install++;
else