From 7852873a1347fcab50393b545cc1e6edd65531c8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 4 Sep 2015 23:29:38 +0200 Subject: Add support for writing by-hash dirs in apt-ftparchive This option is enabled via the APT::FTPArchive::DoByHash switch. It will also honor the option APT::FTPArchive::By-Hash-Keep that controls how many previous generation of by-hash files should be kept (defaults to 3). Merged from https://github.com/mvo5/apt/tree/feature/apt-ftparchive-by-hash --- ftparchive/byhash.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ftparchive/byhash.h (limited to 'ftparchive/byhash.h') diff --git a/ftparchive/byhash.h b/ftparchive/byhash.h new file mode 100644 index 000000000..ce05397ad --- /dev/null +++ b/ftparchive/byhash.h @@ -0,0 +1,23 @@ +// -*- mode: cpp; mode: fold -*- +// Description /*{{{*/ +/* ###################################################################### + + ByHash + + ByHash helper functions + + ##################################################################### */ + /*}}}*/ +#ifndef BYHASH_H +#define BYHASH_H + +class HashString; + +// Delete all files in "dir" except for the number specified in "KeepFiles" +// that are the most recent ones +void DeleteAllButMostRecent(std::string dir, int KeepFiles); + +// takes a regular input filename +std::string GenByHashFilename(std::string Input, HashString h); + +#endif -- cgit v1.2.3