summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:59:52 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:59:52 +0000
commite59458f761e74cc46a5a3606c6e97a95789dea31 (patch)
tree2b617c96caf4c32d762f0910c620d8502022eaf1 /apt-pkg
parenta5eef4f76b4e46f607886eba0da8a03793f201b9 (diff)
Display both current version and new version in apt-get -s.
Author: doogie Date: 2002-11-09 23:10:32 GMT Display both current version and new version in apt-get -s.
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/algorithms.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index aa3e86568..fec16e095 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: algorithms.cc,v 1.41 2002/04/26 05:36:20 jgg Exp $
+// $Id: algorithms.cc,v 1.42 2002/11/09 23:10:32 doogie Exp $
/* ######################################################################
Algorithms - A set of misc algorithms
@@ -49,17 +49,22 @@ pkgSimulate::pkgSimulate(pkgDepCache *Cache) : pkgPackageManager(Cache),
/*}}}*/
// Simulate::Describe - Describe a package /*{{{*/
// ---------------------------------------------------------------------
-/* */
+/* Parameter Now == true gives both current and available varsion,
+ Parameter Now == false gives only the available package version */
void pkgSimulate::Describe(PkgIterator Pkg,ostream &out,bool Now)
{
VerIterator Ver(Sim);
+
+ out << Pkg.Name();
+
if (Now == true)
+ {
Ver = Pkg.CurrentVer();
- else
- Ver = Sim[Pkg].CandidateVerIter(Sim);
+ if (Ver.end() == false)
+ out << " [" << Ver.VerStr() << ']';
+ }
- out << Pkg.Name();
-
+ Ver = Sim[Pkg].CandidateVerIter(Sim);
if (Ver.end() == true)
return;
@@ -76,7 +81,7 @@ bool pkgSimulate::Install(PkgIterator iPkg,string /*File*/)
Flags[Pkg->ID] = 1;
cout << "Inst ";
- Describe(Pkg,cout,false);
+ Describe(Pkg,cout,true);
Sim.MarkInstall(Pkg,false);
// Look for broken conflicts+predepends.