]>
git.saurik.com Git - apt.git/blob - apt-pkg/indexcopy.h
1 // -*- mode: cpp; mode: fold -*-
3 /* ######################################################################
5 Index Copying - Aid for copying and verifying the index files
7 ##################################################################### */
16 #include <apt-pkg/macros.h>
18 #ifndef APT_10_CLEANER_HEADERS
19 #include <apt-pkg/gpgv.h>
22 #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(FileFd
&Target
, std::string
const &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
,
60 class PackageCopy
: public IndexCopy
/*{{{*/
65 virtual bool GetFile(std::string
&Filename
,unsigned long long &Size
) APT_OVERRIDE
;
66 virtual bool RewriteEntry(FileFd
&Target
, std::string
const &File
) APT_OVERRIDE
;
67 virtual const char *GetFileName() APT_OVERRIDE
{return "Packages";};
68 virtual const char *Type() APT_OVERRIDE
{return "Package";};
72 virtual ~PackageCopy();
75 class SourceCopy
: public IndexCopy
/*{{{*/
80 virtual bool GetFile(std::string
&Filename
,unsigned long long &Size
) APT_OVERRIDE
;
81 virtual bool RewriteEntry(FileFd
&Target
, std::string
const &File
) APT_OVERRIDE
;
82 virtual const char *GetFileName() APT_OVERRIDE
{return "Sources";};
83 virtual const char *Type() APT_OVERRIDE
{return "Source";};
87 virtual ~SourceCopy();
90 class TranslationsCopy
/*{{{*/
94 pkgTagSection
*Section
;
97 bool CopyTranslations(std::string CDROM
,std::string Name
,std::vector
<std::string
> &List
,
101 virtual ~TranslationsCopy();
104 class SigVerify
/*{{{*/
106 /** \brief dpointer placeholder (for later in case we need it) */
109 APT_HIDDEN
bool Verify(std::string prefix
,std::string file
, metaIndex
*records
);
110 APT_HIDDEN
bool CopyMetaIndex(std::string CDROM
, std::string CDName
,
111 std::string prefix
, std::string file
);
114 bool CopyAndVerify(std::string CDROM
,std::string Name
,std::vector
<std::string
> &SigList
,
115 std::vector
<std::string
> PkgList
,std::vector
<std::string
> SrcList
);
117 APT_DEPRECATED
static bool RunGPGV(std::string
const &File
, std::string
const &FileOut
,
118 int const &statusfd
, int fd
[2]);
119 APT_DEPRECATED
static bool RunGPGV(std::string
const &File
, std::string
const &FileOut
,
120 int const &statusfd
= -1);
123 virtual ~SigVerify();