summaryrefslogtreecommitdiff
path: root/cmdline/apt-cache.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:50:50 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:50:50 +0000
commit8efa2a3ba4ae833415223a888e4561e57e4bf132 (patch)
tree3935e15c8802549d872c4f2569c0329739e3aea4 /cmdline/apt-cache.cc
parent1164783d22d97e7ca0454e23faad8f8bb70a901d (diff)
Working cache generator
Author: jgg Date: 1998-07-16 06:08:36 GMT Working cache generator
Diffstat (limited to 'cmdline/apt-cache.cc')
-rw-r--r--cmdline/apt-cache.cc20
1 files changed, 14 insertions, 6 deletions
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 <apt-pkg/error.h>
#include <apt-pkg/pkgcachegen.h>
#include <apt-pkg/deblistparser.h>
+#include <apt-pkg/init.h>
#include <iostream.h>
#include <fstream.h>
@@ -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)