Просмотр исходного кода

* 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)

David Kalnischkies лет назад: 16
Родитель
Сommit
ca964703dd
2 измененных файлов с 13 добавлено и 2 удалено
  1. 10 2
      cmdline/apt-cache.cc
  2. 3 0
      debian/changelog

+ 10 - 2
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;

+ 3 - 0
debian/changelog

@@ -24,6 +24,9 @@ apt (0.7.26~exp4) experimental; urgency=low
       Thanks to Kel Modderman for report & patch! (Closes: #577226)
   * ftparchive/writer.cc:
     - remove 999 chars Files and Checksums rewrite limit (Closes: #577759)
+  * 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)
 
   [ Jari Aalto ]
   * cmdline/apt-get.cc: