X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/4c265635a8417b857a3a8f537c74313d5533da9b..fd95168ffb354257963a3b3ee1a199bd8c1b3c1d:/ftparchive/writer.h diff --git a/ftparchive/writer.h b/ftparchive/writer.h index 49d430c47..86884dcfc 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -13,16 +13,17 @@ #ifndef WRITER_H #define WRITER_H - #include #include #include #include #include #include +#include +#include +#include "contents.h" #include "cachedb.h" -#include "multicompress.h" #include "override.h" #include "apt-ftparchive.h" @@ -31,7 +32,7 @@ using std::cout; using std::endl; using std::vector; using std::map; - + class FTWScanner { protected: @@ -48,7 +49,7 @@ class FTWScanner static int ScannerFile(const char *File, bool const &ReadLink); bool Delink(string &FileName,const char *OriginalPath, - unsigned long &Bytes,off_t const &FileSize); + unsigned long long &Bytes,unsigned long long const &FileSize); inline void NewLine(unsigned const &Priority) { @@ -60,6 +61,10 @@ class FTWScanner } public: + bool DoMD5; + bool DoSHA1; + bool DoSHA256; + bool DoSHA512; unsigned long DeLinkLimit; string InternalPrefix; @@ -69,12 +74,16 @@ class FTWScanner bool LoadFileList(string const &BaseDir,string const &File); void ClearPatterns() { Patterns.clear(); }; void AddPattern(string const &Pattern) { Patterns.push_back(Pattern); }; + void AddPattern(char const *Pattern) { Patterns.push_back(Pattern); }; + void AddPatterns(std::vector const &patterns) { Patterns.insert(Patterns.end(), patterns.begin(), patterns.end()); }; bool SetExts(string const &Vals); FTWScanner(string const &Arch = string()); virtual ~FTWScanner() {}; }; +class MultiCompress; + class TranslationWriter { MultiCompress *Comp; @@ -101,9 +110,6 @@ class PackagesWriter : public FTWScanner public: // Some flags - bool DoMD5; - bool DoSHA1; - bool DoSHA256; bool DoAlwaysStat; bool NoOverride; bool DoContents; @@ -153,14 +159,16 @@ class ContentsWriter : public FTWScanner class SourcesWriter : public FTWScanner { + CacheDB Db; Override BOver; Override SOver; char *Buffer; - unsigned long BufSize; + unsigned long long BufSize; public: bool NoOverride; + bool DoAlwaysStat; // General options string PathPrefix; @@ -170,7 +178,7 @@ class SourcesWriter : public FTWScanner virtual bool DoPackage(string FileName); - SourcesWriter(string const &BOverrides,string const &SOverrides, + SourcesWriter(string const &DB,string const &BOverrides,string const &SOverrides, string const &ExtOverrides=string()); virtual ~SourcesWriter() {free(Buffer);}; }; @@ -193,8 +201,9 @@ protected: string MD5; string SHA1; string SHA256; + string SHA512; // Limited by FileFd::Size() - unsigned long size; + unsigned long long size; ~CheckSum() {}; }; map CheckSums;