summaryrefslogtreecommitdiff
path: root/ftparchive
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-01-20 16:01:40 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-01-20 16:01:40 +0100
commit3cb3fe76e90283a5b3fe7105e4854d4bac13bfeb (patch)
tree773b6bbedbc9d122ebc21a84f9db680b93813f4f /ftparchive
parentfe0f7911b650918e1d511b3453664a07f6d966d0 (diff)
* ftparchive/writer.cc:
- add config option to search for more patterns in release command
Diffstat (limited to 'ftparchive')
-rw-r--r--ftparchive/writer.cc26
-rw-r--r--ftparchive/writer.h2
2 files changed, 17 insertions, 11 deletions
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index d7d699ddc..55fac89bd 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -306,7 +306,7 @@ PackagesWriter::PackagesWriter(string const &DB,string const &Overrides,string c
Output = stdout;
SetExts(".deb .udeb");
DeLinkLimit = 0;
-
+
// Process the command line options
DoMD5 = _config->FindB("APT::FTPArchive::MD5",true);
DoSHA1 = _config->FindB("APT::FTPArchive::SHA1",true);
@@ -907,16 +907,20 @@ bool ContentsWriter::ReadFromPkgs(string const &PkgFile,string const &PkgCompres
/* */
ReleaseWriter::ReleaseWriter(string const &DB)
{
- AddPattern("Packages");
- AddPattern("Packages.gz");
- AddPattern("Packages.bz2");
- AddPattern("Packages.lzma");
- AddPattern("Sources");
- AddPattern("Sources.gz");
- AddPattern("Sources.bz2");
- AddPattern("Sources.lzma");
- AddPattern("Release");
- AddPattern("md5sum.txt");
+ if (_config->FindB("APT::FTPArchive::Release::Default-Patterns", true) == true)
+ {
+ AddPattern("Packages");
+ AddPattern("Packages.gz");
+ AddPattern("Packages.bz2");
+ AddPattern("Packages.lzma");
+ AddPattern("Sources");
+ AddPattern("Sources.gz");
+ AddPattern("Sources.bz2");
+ AddPattern("Sources.lzma");
+ AddPattern("Release");
+ AddPattern("md5sum.txt");
+ }
+ AddPatterns(_config->FindVector("APT::FTPArchive::Release::Patterns"));
Output = stdout;
time_t const now = time(NULL);
diff --git a/ftparchive/writer.h b/ftparchive/writer.h
index 49d430c47..3796f79f6 100644
--- a/ftparchive/writer.h
+++ b/ftparchive/writer.h
@@ -69,6 +69,8 @@ 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<std::string> const &patterns) { Patterns.insert(Patterns.end(), patterns.begin(), patterns.end()); };
bool SetExts(string const &Vals);
FTWScanner(string const &Arch = string());