From f8f410f57e7941a7bf57c5c84b77b2bcd577ac6b Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:54:55 +0000 Subject: apt-cache showsrc Author: jgg Date: 1999-10-18 03:44:39 GMT apt-cache showsrc --- cmdline/apt-cache.cc | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'cmdline/apt-cache.cc') 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 #include #include +#include #include #include @@ -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); -- cgit v1.2.3-70-g09d2