// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: debsrcrecords.h,v 1.3 1999/04/07 05:51:01 jgg Exp $
+// $Id: debsrcrecords.h,v 1.4 1999/10/18 03:44:39 jgg Exp $
/* ######################################################################
Debian Source Package Records - Parser implementation for Debian style
virtual string Section() {return Sect.FindS("Section");};
virtual const char **Binaries();
virtual unsigned long Offset() {return iOffset;};
+ virtual unsigned long Length() {return Sec.size();};
+ virtual string AsStr()
+ {
+ const char *Start,Stop;
+ Sect.GetSection(Start,Stop);
+ return string(Start,Stop);
+ };
virtual bool Files(vector<pkgSrcRecords::File> &F);
debSrcRecordParser(FileFd *File,pkgSourceList::const_iterator SrcItem) :
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: srcrecords.h,v 1.4 1999/07/20 05:53:33 jgg Exp $
+// $Id: srcrecords.h,v 1.5 1999/10/18 03:44:39 jgg Exp $
/* ######################################################################
Source Package Records - Allows access to source package records
virtual bool Step() = 0;
virtual bool Jump(unsigned long Off) = 0;
virtual unsigned long Offset() = 0;
+ virtual string AsStr() = 0;
virtual string Package() = 0;
virtual string Version() = 0;
// -*- 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
#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>
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 /*{{{*/
// ---------------------------------------------------------------------
/* */
CommandLine::Dispatch CmdsA[] = {{"help",&ShowHelp},
{"add",&DoAdd},
{"gencaches",&GenCaches},
+ {"showsrc",&ShowSrcPackage},
{0,0}};
CommandLine::Dispatch CmdsB[] = {{"showpkg",&DumpPackage},
{"stats",&Stats},
// Open the cache file
pkgSourceList List;
List.ReadMainList();
-
+
// Generate it and map it
OpProgress Prog;
Map = pkgMakeStatusCacheMem(List,Prog);
* Unmounts CDROMs iff it mounted them Closes: #45299
* Checks for the partial directories before doing downloads Closes: #47392
* no_proxy environment variable (http only!) Closes: #43476
+ * apt-cache showsrc Closes: #45799
-- Jason Gunthorpe <jgg@debian.org> Fri, 3 Sep 1999 09:04:28 -0700