]> git.saurik.com Git - apt.git/commitdiff
apt-cache showsrc
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:54:55 +0000 (16:54 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:54:55 +0000 (16:54 +0000)
Author: jgg
Date: 1999-10-18 03:44:39 GMT
apt-cache showsrc

apt-pkg/deb/debsrcrecords.h
apt-pkg/srcrecords.h
cmdline/apt-cache.cc
debian/changelog

index 426b914e8966023a6d59852addf07552d84ee96f..e09a57f3cae555d3513027578beb52457832db74 100644 (file)
@@ -1,6 +1,6 @@
 // -*- 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
@@ -38,6 +38,13 @@ class debSrcRecordParser : public pkgSrcRecords::Parser
    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) : 
index 17297a60eb2845019c3d2ab306683013ede85d44..8391349dd45a48a6472313b390de9532ed4a492a 100644 (file)
@@ -1,6 +1,6 @@
 // -*- 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
@@ -46,6 +46,7 @@ class pkgSrcRecords
       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;
index b825bd4f9e875c229b40ad984b0392b73009041c..5bb9db7ccf0f7fa7fb7a4f8133c4c77af0ed059b 100644 (file)
@@ -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);
index 0a2ef08cf097dfe76dbe539c60f29fca8f8e0b20..c97f18ae4d73b59e90cc78251740f6403db28a62 100644 (file)
@@ -19,6 +19,7 @@ apt (0.3.13.1) unstable; urgency=low
   * 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