]>
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/macros.h>
19 #ifndef APT_10_CLEANER_HEADERS
20 #include <apt-pkg/gpgv.h>
23 #ifndef APT_8_CLEANER_HEADERS
32 class IndexCopy
/*{{{*/
34 /** \brief dpointer placeholder (for later in case we need it) */
39 pkgTagSection
*Section
;
41 std::string
ChopDirs(std::string Path
,unsigned int Depth
);
42 bool ReconstructPrefix(std::string
&Prefix
,std::string OrigPath
,std::string CD
,
44 bool ReconstructChop(unsigned long &Chop
,std::string Dir
,std::string File
);
45 void ConvertToSourceList(std::string CD
,std::string
&Path
);
46 bool GrabFirst(std::string Path
,std::string
&To
,unsigned int Depth
);
47 virtual bool GetFile(std::string
&Filename
,unsigned long long &Size
) = 0;
48 virtual bool RewriteEntry(FILE *Target
,std::string File
) = 0;
49 virtual const char *GetFileName() = 0;
50 virtual const char *Type() = 0;
54 bool CopyPackages(std::string CDROM
,std::string Name
,std::vector
<std::string
> &List
,
56 virtual ~IndexCopy() {};
59 class PackageCopy
: public IndexCopy
/*{{{*/
63 virtual bool GetFile(std::string
&Filename
,unsigned long long &Size
);
64 virtual bool RewriteEntry(FILE *Target
,std::string File
);
65 virtual const char *GetFileName() {return "Packages";};
66 virtual const char *Type() {return "Package";};
70 class SourceCopy
: public IndexCopy
/*{{{*/
74 virtual bool GetFile(std::string
&Filename
,unsigned long long &Size
);
75 virtual bool RewriteEntry(FILE *Target
,std::string File
);
76 virtual const char *GetFileName() {return "Sources";};
77 virtual const char *Type() {return "Source";};
81 class TranslationsCopy
/*{{{*/
84 pkgTagSection
*Section
;
87 bool CopyTranslations(std::string CDROM
,std::string Name
,std::vector
<std::string
> &List
,
91 class SigVerify
/*{{{*/
93 /** \brief dpointer placeholder (for later in case we need it) */
96 bool Verify(std::string prefix
,std::string file
, indexRecords
*records
);
97 bool CopyMetaIndex(std::string CDROM
, std::string CDName
,
98 std::string prefix
, std::string file
);
101 bool CopyAndVerify(std::string CDROM
,std::string Name
,std::vector
<std::string
> &SigList
,
102 std::vector
<std::string
> PkgList
,std::vector
<std::string
> SrcList
);
104 APT_DEPRECATED
static bool RunGPGV(std::string
const &File
, std::string
const &FileOut
,
105 int const &statusfd
, int fd
[2]);
106 APT_DEPRECATED
static bool RunGPGV(std::string
const &File
, std::string
const &FileOut
,
107 int const &statusfd
= -1);