]>
git.saurik.com Git - apt.git/blob - apt-pkg/indexcopy.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: indexcopy.h,v 1.3 2001/05/27 04:46:54 jgg Exp $
4 /* ######################################################################
6 Index Copying - Aid for copying and verifying the index files
8 ##################################################################### */
17 #include <apt-pkg/gpgv.h>
18 #include <apt-pkg/macros.h>
20 #ifndef APT_8_CLEANER_HEADERS
30 class IndexCopy
/*{{{*/
32 /** \brief dpointer placeholder (for later in case we need it) */
37 pkgTagSection
*Section
;
39 std::string
ChopDirs(std::string Path
,unsigned int Depth
);
40 bool ReconstructPrefix(std::string
&Prefix
,std::string OrigPath
,std::string CD
,
42 bool ReconstructChop(unsigned long &Chop
,std::string Dir
,std::string File
);
43 void ConvertToSourceList(std::string CD
,std::string
&Path
);
44 bool GrabFirst(std::string Path
,std::string
&To
,unsigned int Depth
);
45 virtual bool GetFile(std::string
&Filename
,unsigned long long &Size
) = 0;
46 virtual bool RewriteEntry(FILE *Target
,std::string File
) = 0;
47 virtual const char *GetFileName() = 0;
48 virtual const char *Type() = 0;
52 bool CopyPackages(std::string CDROM
,std::string Name
,std::vector
<std::string
> &List
,
54 virtual ~IndexCopy() {};
57 class PackageCopy
: public IndexCopy
/*{{{*/
61 virtual bool GetFile(std::string
&Filename
,unsigned long long &Size
);
62 virtual bool RewriteEntry(FILE *Target
,std::string File
);
63 virtual const char *GetFileName() {return "Packages";};
64 virtual const char *Type() {return "Package";};
68 class SourceCopy
: public IndexCopy
/*{{{*/
72 virtual bool GetFile(std::string
&Filename
,unsigned long long &Size
);
73 virtual bool RewriteEntry(FILE *Target
,std::string File
);
74 virtual const char *GetFileName() {return "Sources";};
75 virtual const char *Type() {return "Source";};
79 class TranslationsCopy
/*{{{*/
82 pkgTagSection
*Section
;
85 bool CopyTranslations(std::string CDROM
,std::string Name
,std::vector
<std::string
> &List
,
89 class SigVerify
/*{{{*/
91 /** \brief dpointer placeholder (for later in case we need it) */
94 bool Verify(std::string prefix
,std::string file
, indexRecords
*records
);
95 bool CopyMetaIndex(std::string CDROM
, std::string CDName
,
96 std::string prefix
, std::string file
);
99 bool CopyAndVerify(std::string CDROM
,std::string Name
,std::vector
<std::string
> &SigList
,
100 std::vector
<std::string
> PkgList
,std::vector
<std::string
> SrcList
);
102 __deprecated
static bool RunGPGV(std::string
const &File
, std::string
const &FileOut
,
103 int const &statusfd
, int fd
[2]) {
104 ExecGPGV(File
, FileOut
, statusfd
, fd
);
107 __deprecated
static bool RunGPGV(std::string
const &File
, std::string
const &FileOut
,
108 int const &statusfd
= -1) {
109 ExecGPGV(File
, FileOut
, statusfd
);