From 803ea2a87f81252b2c0d541b8502ed206ce57c84 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 12 Feb 2010 00:04:31 +0100 Subject: 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. --- cmdline/apt-cache.cc | 2 ++ cmdline/apt-get.cc | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index cd806286c..275daa187 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1587,6 +1587,8 @@ bool Policy(CommandLine &CmdL) } for (; Pkg.end() != true; Pkg = Grp.NextPkg(Pkg)) { + if (strcmp(Pkg.Arch(),"all") == 0) + continue; if (myArch == Pkg.Arch()) cout << Pkg.Name() << ":" << endl; diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 2597a6acb..93065004c 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -233,7 +233,7 @@ bool ShowList(ostream &out,string Title,string List,string VersionsList) if it is not the main architecture */ string ShowPkg(pkgCache::PkgIterator const Pkg) { string p = Pkg.Name(); - if (_config->Find("APT::Architecture") != Pkg.Arch()) + if (strcmp(Pkg.Arch(),"all") != 0 && _config->Find("APT::Architecture") != Pkg.Arch()) p.append(":").append(Pkg.Arch()); return p; } @@ -385,6 +385,8 @@ void ShowNew(ostream &out,CacheFile &Cache) { pkgCache::PkgIterator I(Cache,Cache.List[J]); if (Cache[I].NewInstall() == true) { + if (Cache[I].CandidateVerIter(Cache).Pseudo() == true) + continue; List += ShowPkg(I) + " "; VersionsList += string(Cache[I].CandVersion) + "\n"; } @@ -407,6 +409,8 @@ void ShowDel(ostream &out,CacheFile &Cache) pkgCache::PkgIterator I(Cache,Cache.List[J]); if (Cache[I].Delete() == true) { + if (Cache[I].CandidateVerIter(Cache).Pseudo() == true) + continue; if ((Cache[I].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge) List += ShowPkg(I) + "* "; else @@ -455,7 +459,9 @@ void ShowUpgraded(ostream &out,CacheFile &Cache) // Not interesting if (Cache[I].Upgrade() == false || Cache[I].NewInstall() == true) continue; - + if (Cache[I].CandidateVerIter(Cache).Pseudo() == true) + continue; + List += ShowPkg(I) + " "; VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n"; } @@ -476,7 +482,9 @@ bool ShowDowngraded(ostream &out,CacheFile &Cache) // Not interesting if (Cache[I].Downgrade() == false || Cache[I].NewInstall() == true) continue; - + if (Cache[I].CandidateVerIter(Cache).Pseudo() == true) + continue; + List += ShowPkg(I) + " "; VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n"; } -- cgit v1.2.3