From 3cb3fe76e90283a5b3fe7105e4854d4bac13bfeb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 20 Jan 2011 16:01:40 +0100 Subject: * ftparchive/writer.cc: - add config option to search for more patterns in release command --- ftparchive/writer.cc | 26 +++++++++++++++----------- ftparchive/writer.h | 2 ++ 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'ftparchive') 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 const &patterns) { Patterns.insert(Patterns.end(), patterns.begin(), patterns.end()); }; bool SetExts(string const &Vals); FTWScanner(string const &Arch = string()); -- cgit v1.2.3 From 8d16c61781068762a83edb6a75b3343eb6000585 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 24 Jan 2011 15:37:59 +0100 Subject: include Index files by default in the Release file --- ftparchive/writer.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'ftparchive') diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 55fac89bd..9cdca8d3e 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -918,6 +918,7 @@ ReleaseWriter::ReleaseWriter(string const &DB) AddPattern("Sources.bz2"); AddPattern("Sources.lzma"); AddPattern("Release"); + AddPattern("Index"); AddPattern("md5sum.txt"); } AddPatterns(_config->FindVector("APT::FTPArchive::Release::Patterns")); -- cgit v1.2.3