diff options
-rw-r--r-- | debian/changelog | 4 | ||||
-rw-r--r-- | doc/apt-ftparchive.1.xml | 11 | ||||
-rw-r--r-- | ftparchive/writer.cc | 26 | ||||
-rw-r--r-- | ftparchive/writer.h | 2 |
4 files changed, 27 insertions, 16 deletions
diff --git a/debian/changelog b/debian/changelog index 59f516751..ca88901a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -59,8 +59,10 @@ apt (0.8.11+wheezy) unstable; urgency=low can be used without being root (Closes: #393005, #592107) * apt-pkg/deb/deblistparser.cc: - rewrite LoadReleaseInfo to cope with clearsigned Releasefiles + * ftparchive/writer.cc: + - add config option to search for more patterns in release command - -- David Kalnischkies <kalnischkies@gmail.com> Thu, 20 Jan 2011 14:52:32 +0100 + -- David Kalnischkies <kalnischkies@gmail.com> Thu, 20 Jan 2011 16:00:54 +0100 apt (0.8.10) unstable; urgency=low diff --git a/doc/apt-ftparchive.1.xml b/doc/apt-ftparchive.1.xml index 852da8ad1..0090d21d9 100644 --- a/doc/apt-ftparchive.1.xml +++ b/doc/apt-ftparchive.1.xml @@ -113,10 +113,13 @@ <varlistentry><term>release</term> <listitem><para> The <literal>release</literal> command generates a Release file from a - directory tree. It recursively searches the given directory for - Packages, Packages.gz, Packages.bz2, Sources, Sources.gz, - Sources.bz2, Release and md5sum.txt files. It then writes to - stdout a Release file containing an MD5 digest and SHA1 digest + directory tree. It recursively searches the given directory for uncompressed + <filename>Packages</filename> and <filename>Sources</filename> files and the ones + compressed with <command>gzip</command>, <command>bzip2</command> or <command>lzma</command> + as well as <filename>Release</filename> and <filename>md5sum.txt</filename> files by default + (<literal>APT::FTPArchive::Release::Default-Patterns</literal>). Additional filename patterns + can be added by listing them in <literal>APT::FTPArchive::Release::Patterns</literal>. + It then writes to stdout a Release file containing a MD5, SHA1 and SHA256 digest for each file.</para> <para> Values for the additional metadata fields in the Release file are 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()); |