From 8efa2a3ba4ae833415223a888e4561e57e4bf132 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:50:50 +0000 Subject: Working cache generator Author: jgg Date: 1998-07-16 06:08:36 GMT Working cache generator --- cmdline/apt-cache.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index ce7ccc2c9..ac5dc17ca 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.1 1998/07/15 05:56:47 jgg Exp $ +// $Id: apt-cache.cc,v 1.2 1998/07/16 06:08:43 jgg Exp $ /* ###################################################################### apt-cache - Manages the cache file. @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -89,17 +90,19 @@ bool DoAdd(int argc,char *argv[]) { if (SplitArg(argv[I],FileName,Dist,Ver) == false) return false; + cout << FileName << endl; // Do the merge File TagF(FileName.c_str(),File::ReadOnly); debListParser Parser(TagF); if (_error->PendingError() == true) - return false; + return _error->Error("Problem opening %s",FileName.c_str()); + if (Gen.SelectFile(FileName) == false) - return false; + return _error->Error("Problem with SelectFile"); if (Gen.MergeList(Parser) == false) - return false; + return _error->Error("Problem with MergeList"); } return true; @@ -157,7 +160,11 @@ bool DumpPackage(int argc,char *argv[]) for (pkgCache::PrvIterator Prv = Cur.ProvidesList(); Prv.end() != true; Prv++) cout << Prv.ParentPkg().Name() << " "; cout << endl; - } + } + cout << "Reverse Provides: " << endl; + for (pkgCache::PrvIterator Prv = Pkg.ProvidesList(); Prv.end() != true; Prv++) + cout << Prv.OwnerPkg().Name() << " " << Prv.OwnerVer().VerStr(); + cout << endl; } return true; @@ -333,7 +340,8 @@ int main(int argc, char *argv[]) cerr << "Usage is apt-cache add cache file1:dist:ver file2:dist:ver ..." << endl; return 100; } - + + pkgInitialize(*_config); while (1) { if (strcmp(argv[1],"add") == 0) -- cgit v1.2.3