summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-04-23 17:19:57 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-04-23 17:19:57 +0200
commitca964703dd3442724c0ccac0ade717042ca8fce5 (patch)
tree94f6c6b6b067a53aa8f47a602446fee6cd00a7cb /cmdline
parentbf99a6d3307af667a23fe09bfc437a553bbbd182 (diff)
* cmdline/apt-cache.cc:
- align Installed and Candidate Version in policy so they can be compared easier, thanks Ralf Gesellensetter for the pointer! (Closes: #578657)
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-cache.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 07b95e3ca..b0034bf6d 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -1585,6 +1585,14 @@ bool Policy(CommandLine &CmdL)
}
string const myArch = _config->Find("APT::Architecture");
+ char const * const msgInstalled = _(" Installed: ");
+ char const * const msgCandidate = _(" Candidate: ");
+ short const InstalledLessCandidate =
+ mbstowcs(NULL, msgInstalled, 0) - mbstowcs(NULL, msgCandidate, 0);
+ short const deepInstalled =
+ (InstalledLessCandidate < 0 ? (InstalledLessCandidate*-1) : 0) - 1;
+ short const deepCandidate =
+ (InstalledLessCandidate > 0 ? (InstalledLessCandidate) : 0) - 1;
// Print out detailed information for each package
for (const char **I = CmdL.FileList + 1; *I != 0; I++)
@@ -1604,14 +1612,14 @@ bool Policy(CommandLine &CmdL)
cout << Pkg.FullName(true) << ":" << endl;
// Installed version
- cout << _(" Installed: ");
+ cout << msgInstalled << OutputInDepth(deepInstalled, " ");
if (Pkg->CurrentVer == 0)
cout << _("(none)") << endl;
else
cout << Pkg.CurrentVer().VerStr() << endl;
// Candidate Version
- cout << _(" Candidate: ");
+ cout << msgCandidate << OutputInDepth(deepCandidate, " ");
pkgCache::VerIterator V = Plcy.GetCandidateVer(Pkg);
if (V.end() == true)
cout << _("(none)") << endl;