~ubuntu-branches/ubuntu/maverick/apt/maverick-security

« back to all changes in this revision

Viewing changes to apt-pkg/srcrecords.h

  • Committer: Bazaar Package Importer
  • Author(s): Jason Gunthorpe
  • Date: 2001-08-18 17:21:59 UTC
  • Revision ID: james.westby@ubuntu.com-20010818172159-85f7g43wdzi9dwb5
Tags: 0.5.4
* M68k config.guess patch. Closes: #88913
* Bi-yearly test on OpenBSD and Solaris
* Doc updates. Closes: #89121, #89854, #99671, #98353, #95823, #93057,
        #97520, #102867, #101071, #102421, #101565, #98272, #106914,
        #105606, #105377
* Various cosmetic code updates. Closes: #89066, #89066, #89152
* Add "pre-auto" as an option for DSelect::Clean (run autoclean after
  update).
* More patches from Alfredo for Vendors and more SHA-1 stuff
* Fix for AJ's 'desire to remove perl-5.005' and possibly other
  similar situations. Closes: #56708, #59432
* no_proxy and ftp. Closes: #89671
* Philippe Batailler's man page patches.
* Fix for display bug. Closes: #92033, #93652, #98468
* Use more than 16bits for the dep ID. Some people ran out..
  Closes: #103020, #97809, #102951, #99974, #107362, #107395, #107362,
          #106911, #107395, #108968
* Reordered some things to make dante and FTP happier. Closes: #92757
* James R. Van Zandt's guide.sgml updates. Closes: #90027
* apt-ftparchive copes with no uncompressed package files + contents.
* French man pages from philippe batailler - well sort of. They 
  don't build yet..
* run-parts. Closes: #94286
* 'apt-cache policy' preferences debug tool.
* Whatever. Closes: #89762
* libstdc++ and HURD. Closes: #92025
* More apt-utils verbage. Closes: #86954
* Fliped comparision operator. Closes: #94618
* Used the right copyright file. Closes: #65691
* Randolph's G++3 patches. 
* Fixed no_proxy tokanizing. Closes: #100046
* Strip Config-Version when copying status to available. Closes: #97520
* Segfault with missing source files. Closes: #100325
* EINTR check. Closes: #102293
* Various changes to the locking metholodgy for --print-uris. 
  Closes: #100590
* Lame LD_LIBRARY_PATH thing. Closes: #98928
* apt-cache search searchs provide names too now. Closes: #98695
* Checksum and long lines problem. Closes: #106591
* .aptignr and empty files are just a warning. Closes: #97364  

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode: cpp; mode: fold -*-
 
2
// Description                                                          /*{{{*/
 
3
// $Id: srcrecords.h,v 1.7 2001/05/07 04:24:08 jgg Exp $
 
4
/* ######################################################################
 
5
   
 
6
   Source Package Records - Allows access to source package records
 
7
   
 
8
   Parses and allows access to the list of source records and searching by
 
9
   source name on that list.
 
10
   
 
11
   ##################################################################### */
 
12
                                                                        /*}}}*/
 
13
#ifndef PKGLIB_SRCRECORDS_H
 
14
#define PKGLIB_SRCRECORDS_H
 
15
 
 
16
#ifdef __GNUG__
 
17
#pragma interface "apt-pkg/srcrecords.h"
 
18
#endif 
 
19
 
 
20
#include <string>
 
21
#include <vector>    
 
22
 
 
23
using std::string;
 
24
using std::vector;
 
25
 
 
26
class pkgSourceList;
 
27
class pkgIndexFile;
 
28
class pkgSrcRecords
 
29
{
 
30
   public:
 
31
 
 
32
   // Describes a single file
 
33
   struct File
 
34
   {
 
35
      string MD5Hash;
 
36
      unsigned long Size;
 
37
      string Path;
 
38
      string Type;
 
39
   };
 
40
   
 
41
   // Abstract parser for each source record
 
42
   class Parser
 
43
   {
 
44
      protected:
 
45
      
 
46
      const pkgIndexFile *iIndex;
 
47
      
 
48
      public:
 
49
 
 
50
      enum BuildDep {BuildDepend=0x0,BuildDependIndep=0x1,
 
51
                     BuildConflict=0x2,BuildConflictIndep=0x3};
 
52
 
 
53
      struct BuildDepRec 
 
54
      {
 
55
         string Package;
 
56
         string Version;
 
57
         unsigned int Op;
 
58
         unsigned char Type;
 
59
      };
 
60
        
 
61
      inline const pkgIndexFile &Index() const {return *iIndex;};
 
62
      
 
63
      virtual bool Restart() = 0;
 
64
      virtual bool Step() = 0;
 
65
      virtual bool Jump(unsigned long Off) = 0;
 
66
      virtual unsigned long Offset() = 0;
 
67
      virtual string AsStr() = 0;
 
68
      
 
69
      virtual string Package() const = 0;
 
70
      virtual string Version() const = 0;
 
71
      virtual string Maintainer() const = 0;
 
72
      virtual string Section() const = 0;
 
73
      virtual const char **Binaries() = 0;   // Ownership does not transfer
 
74
 
 
75
      virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps) = 0;
 
76
      static const char *BuildDepType(unsigned char Type);
 
77
 
 
78
      virtual bool Files(vector<pkgSrcRecords::File> &F) = 0;
 
79
      
 
80
      Parser(const pkgIndexFile *Index) : iIndex(Index) {};
 
81
      virtual ~Parser() {};
 
82
   };
 
83
   
 
84
   private:
 
85
   
 
86
   // The list of files and the current parser pointer
 
87
   Parser **Files;
 
88
   Parser **Current;
 
89
   
 
90
   public:
 
91
 
 
92
   // Reset the search
 
93
   bool Restart();
 
94
 
 
95
   // Locate a package by name
 
96
   Parser *Find(const char *Package,bool SrcOnly = false);
 
97
   
 
98
   pkgSrcRecords(pkgSourceList &List);
 
99
   ~pkgSrcRecords();
 
100
};
 
101
 
 
102
#endif