summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-02-11 15:41:04 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-02-11 15:41:04 +0100
commit6293e04ff36cd1cb4756fc30a4777ad6aaf8ffac (patch)
treec5f6dd94eb2396743844d9562dbccf8df58a7b32 /cmdline/apt-get.cc
parent4d174dc84ea184b5afa81abb3b94e2ef3380ece8 (diff)
display the architecture of the package if it is not the default
architecture in apt-get, display policy for all available architectures and use GrpIterator in apt-cache pkgnames
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc33
1 files changed, 22 insertions, 11 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 7325bbf22..2597a6acb 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -227,6 +227,17 @@ bool ShowList(ostream &out,string Title,string List,string VersionsList)
return false;
}
/*}}}*/
+// ShowPkg - display a package name /*{{{*/
+// ---------------------------------------------------------------------
+/* Displays the package name and maybe also the architecture
+ if it is not the main architecture */
+string ShowPkg(pkgCache::PkgIterator const Pkg) {
+ string p = Pkg.Name();
+ if (_config->Find("APT::Architecture") != Pkg.Arch())
+ p.append(":").append(Pkg.Arch());
+ return p;
+}
+ /*}}}*/
// ShowBroken - Debugging aide /*{{{*/
// ---------------------------------------------------------------------
/* This prints out the names of all the packages that are broken along
@@ -258,8 +269,8 @@ void ShowBroken(ostream &out,CacheFile &Cache,bool Now)
}
// Print out each package and the failed dependencies
- out <<" " << I.Name() << ":";
- unsigned Indent = strlen(I.Name()) + 3;
+ out << " " << ShowPkg(I) << " :";
+ unsigned const Indent = ShowPkg(I).size() + 3;
bool First = true;
pkgCache::VerIterator Ver;
@@ -312,7 +323,7 @@ void ShowBroken(ostream &out,CacheFile &Cache,bool Now)
out << ' ' << End.DepType() << ": ";
FirstOr = false;
- out << Start.TargetPkg().Name();
+ out << ShowPkg(Start.TargetPkg());
// Show a quick summary of the version requirements
if (Start.TargetVer() != 0)
@@ -374,7 +385,7 @@ void ShowNew(ostream &out,CacheFile &Cache)
{
pkgCache::PkgIterator I(Cache,Cache.List[J]);
if (Cache[I].NewInstall() == true) {
- List += string(I.Name()) + " ";
+ List += ShowPkg(I) + " ";
VersionsList += string(Cache[I].CandVersion) + "\n";
}
}
@@ -397,9 +408,9 @@ void ShowDel(ostream &out,CacheFile &Cache)
if (Cache[I].Delete() == true)
{
if ((Cache[I].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge)
- List += string(I.Name()) + "* ";
+ List += ShowPkg(I) + "* ";
else
- List += string(I.Name()) + " ";
+ List += ShowPkg(I) + " ";
VersionsList += string(Cache[I].CandVersion)+ "\n";
}
@@ -424,7 +435,7 @@ void ShowKept(ostream &out,CacheFile &Cache)
I->CurrentVer == 0 || Cache[I].Delete() == true)
continue;
- List += string(I.Name()) + " ";
+ List += ShowPkg(I) + " ";
VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n";
}
ShowList(out,_("The following packages have been kept back:"),List,VersionsList);
@@ -445,7 +456,7 @@ void ShowUpgraded(ostream &out,CacheFile &Cache)
if (Cache[I].Upgrade() == false || Cache[I].NewInstall() == true)
continue;
- List += string(I.Name()) + " ";
+ List += ShowPkg(I) + " ";
VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n";
}
ShowList(out,_("The following packages will be upgraded:"),List,VersionsList);
@@ -466,7 +477,7 @@ bool ShowDowngraded(ostream &out,CacheFile &Cache)
if (Cache[I].Downgrade() == false || Cache[I].NewInstall() == true)
continue;
- List += string(I.Name()) + " ";
+ List += ShowPkg(I) + " ";
VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n";
}
return ShowList(out,_("The following packages will be DOWNGRADED:"),List,VersionsList);
@@ -484,7 +495,7 @@ bool ShowHold(ostream &out,CacheFile &Cache)
pkgCache::PkgIterator I(Cache,Cache.List[J]);
if (Cache[I].InstallVer != (pkgCache::Version *)I.CurrentVer() &&
I->SelectedState == pkgCache::State::Hold) {
- List += string(I.Name()) + " ";
+ List += ShowPkg(I) + " ";
VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n";
}
}
@@ -518,7 +529,7 @@ bool ShowEssential(ostream &out,CacheFile &Cache)
if (Added[I->ID] == false)
{
Added[I->ID] = true;
- List += string(I.Name()) + " ";
+ List += ShowPkg(I) + " ";
//VersionsList += string(Cache[I].CurVersion) + "\n"; ???
}
}