From 404ec98e5186c844003dee15e15bc96460cc27a5 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:50:53 +0000 Subject: Generic progress meter Author: jgg Date: 1998-07-21 05:33:18 GMT Generic progress meter --- cmdline/apt-cache.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'cmdline') 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 #include #include +#include #include #include @@ -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; -- cgit v1.2.3