]>
git.saurik.com Git - apt.git/blob - apt-pkg/indexcopy.h
729b0c8cb1a3ba89dd2a62994e5dd584fff1cc52
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
33 class IndexCopy
/*{{{*/
35 /** \brief dpointer placeholder (for later in case we need it) */
40 pkgTagSection
*Section
;
42 std::string
ChopDirs(std::string Path
,unsigned int Depth
);
43 bool ReconstructPrefix(std::string
&Prefix
,std::string OrigPath
,std::string CD
,
45 bool ReconstructChop(unsigned long &Chop
,std::string Dir
,std::string File
);
46 void ConvertToSourceList(std::string CD
,std::string
&Path
);
47 bool GrabFirst(std::string Path
,std::string
&To
,unsigned int Depth
);
48 virtual bool GetFile(std::string
&Filename
,unsigned long long &Size
) = 0;
49 virtual bool RewriteEntry(FileFd
&Target
, std::string
const &File
) = 0;
50 virtual const char *GetFileName() = 0;
51 virtual const char *Type() = 0;
55 bool CopyPackages(std::string CDROM
,std::string Name
,std::vector
<std::string
> &List
,
60 class PackageCopy
: public IndexCopy
/*{{{*/
64 virtual bool GetFile(std::string
&Filename
,unsigned long long &Size
);
65 virtual bool RewriteEntry(FileFd
&Target
, std::string
const &File
);
66 virtual const char *GetFileName() {return "Packages";};
67 virtual const char *Type() {return "Package";};
71 class SourceCopy
: public IndexCopy
/*{{{*/
75 virtual bool GetFile(std::string
&Filename
,unsigned long long &Size
);
76 virtual bool RewriteEntry(FileFd
&Target
, std::string
const &File
);
77 virtual const char *GetFileName() {return "Sources";};
78 virtual const char *Type() {return "Source";};
82 class TranslationsCopy
/*{{{*/
85 pkgTagSection
*Section
;
88 bool CopyTranslations(std::string CDROM
,std::string Name
,std::vector
<std::string
> &List
,
92 class SigVerify
/*{{{*/
94 /** \brief dpointer placeholder (for later in case we need it) */
97 APT_HIDDEN
bool Verify(std::string prefix
,std::string file
, indexRecords
*records
);
98 APT_HIDDEN
bool CopyMetaIndex(std::string CDROM
, std::string CDName
,
99 std::string prefix
, std::string file
);
102 bool CopyAndVerify(std::string CDROM
,std::string Name
,std::vector
<std::string
> &SigList
,
103 std::vector
<std::string
> PkgList
,std::vector
<std::string
> SrcList
);
105 APT_DEPRECATED
static bool RunGPGV(std::string
const &File
, std::string
const &FileOut
,
106 int const &statusfd
, int fd
[2]);
107 APT_DEPRECATED
static bool RunGPGV(std::string
const &File
, std::string
const &FileOut
,
108 int const &statusfd
= -1);