summaryrefslogtreecommitdiff
path: root/cmdline/apt-cache.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:50:53 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:50:53 +0000
commit404ec98e5186c844003dee15e15bc96460cc27a5 (patch)
treeebff8ce1af4234d13f8af5aa021db7cbfe56dc4b /cmdline/apt-cache.cc
parent6fc33863f31051a5fc2726a236ce8b64d33bc964 (diff)
Generic progress meter
Author: jgg Date: 1998-07-21 05:33:18 GMT Generic progress meter
Diffstat (limited to 'cmdline/apt-cache.cc')
-rw-r--r--cmdline/apt-cache.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index b50211fbb..97211a57a 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-cache.cc,v 1.4 1998/07/19 04:42:18 jgg Exp $
+// $Id: apt-cache.cc,v 1.5 1998/07/21 05:33:21 jgg Exp $
/* ######################################################################
apt-cache - Manages the cache file.
@@ -28,6 +28,7 @@
#include <apt-pkg/pkgcachegen.h>
#include <apt-pkg/deblistparser.h>
#include <apt-pkg/init.h>
+#include <apt-pkg/progress.h>
#include <iostream.h>
#include <fstream.h>
@@ -267,16 +268,17 @@ bool DoAdd(int argc,char *argv[])
DynamicMMap Map(CacheF,MMap::Public);
if (_error->PendingError() == true)
return false;
-
- pkgCacheGenerator Gen(Map);
+
+ OpTextProgress Progress;
+ pkgCacheGenerator Gen(Map,Progress);
if (_error->PendingError() == true)
return false;
for (int I = 0; I != argc; I++)
{
+ Progress.OverallProgress(I,argc,1,"Generating cache");
if (SplitArg(argv[I],FileName,Dist,Ver) == false)
return false;
- cout << FileName << endl;
// Do the merge
FileFd TagF(FileName.c_str(),FileFd::ReadOnly);
@@ -290,7 +292,8 @@ bool DoAdd(int argc,char *argv[])
if (Gen.MergeList(Parser) == false)
return _error->Error("Problem with MergeList");
}
-
+
+ Progress.Done();
Stats(Gen.GetCache());
return true;