summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:54:55 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:54:55 +0000
commitf8f410f57e7941a7bf57c5c84b77b2bcd577ac6b (patch)
tree0e9934672e7bd0a1b29c29ccacc4f451bc0cd26e /cmdline
parent9e2a06ff63968286395f3426b689cf7c3914a883 (diff)
downloadapt-f8f410f57e7941a7bf57c5c84b77b2bcd577ac6b.tar.gz
apt-cache showsrc
Author: jgg Date: 1999-10-18 03:44:39 GMT apt-cache showsrc
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-cache.cc28
1 files changed, 26 insertions, 2 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index b825bd4f9..5bb9db7cc 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.38 1999/10/02 04:14:54 jgg Exp $
+// $Id: apt-cache.cc,v 1.39 1999/10/18 03:44:39 jgg Exp $
/* ######################################################################
apt-cache - Manages the cache files
@@ -24,6 +24,7 @@
#include <apt-pkg/cmndline.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/srcrecords.h>
#include <config.h>
#include <iostream.h>
@@ -597,6 +598,28 @@ bool ShowPackage(CommandLine &CmdL)
return true;
}
/*}}}*/
+// ShowSrcPackage - Show source package records /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+bool ShowSrcPackage(CommandLine &CmdL)
+{
+ pkgSourceList List;
+ List.ReadMainList();
+
+ // Create the text record parsers
+ pkgSrcRecords SrcRecs(List);
+ if (_error->PendingError() == true)
+ return false;
+
+ for (const char **I = CmdL.FileList + 1; *I != 0; I++)
+ {
+ pkgSrcRecords::Parser *Parse;
+ while ((Parse = SrcRecs.Find(*I,false)) != 0)
+ cout << Parse->AsStr();
+ }
+ return true;
+}
+ /*}}}*/
// GenCaches - Call the main cache generator /*{{{*/
// ---------------------------------------------------------------------
/* */
@@ -680,6 +703,7 @@ int main(int argc,const char *argv[])
CommandLine::Dispatch CmdsA[] = {{"help",&ShowHelp},
{"add",&DoAdd},
{"gencaches",&GenCaches},
+ {"showsrc",&ShowSrcPackage},
{0,0}};
CommandLine::Dispatch CmdsB[] = {{"showpkg",&DumpPackage},
{"stats",&Stats},
@@ -725,7 +749,7 @@ int main(int argc,const char *argv[])
// Open the cache file
pkgSourceList List;
List.ReadMainList();
-
+
// Generate it and map it
OpProgress Prog;
Map = pkgMakeStatusCacheMem(List,Prog);