diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2010-06-09 00:12:14 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2010-06-09 00:12:14 +0200 |
commit | c99e48ec26e693d9aa4a2a9f868284f7aa49784d (patch) | |
tree | 3e395a2cfce47076037885212a6453a94034a99b /ftparchive | |
parent | bbde96a611f39f5040b332dae1515207db341743 (diff) |
* ftparchive/writer.cc:
- add ValidTime option to generate a Valid-Until header in Release file
Diffstat (limited to 'ftparchive')
-rw-r--r-- | ftparchive/writer.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 6cda29b21..650eec57c 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -924,6 +924,15 @@ ReleaseWriter::ReleaseWriter(string const &DB) datestr[0] = '\0'; } + time_t const validuntil = now + _config->FindI("APT::FTPArchive::Release::ValidTime", 0); + char validstr[128]; + if (now == validuntil || + strftime(validstr, sizeof(validstr), "%a, %d %b %Y %H:%M:%S UTC", + gmtime(&validuntil)) == 0) + { + datestr[0] = '\0'; + } + map<string,string> Fields; Fields["Origin"] = ""; Fields["Label"] = ""; @@ -931,6 +940,7 @@ ReleaseWriter::ReleaseWriter(string const &DB) Fields["Version"] = ""; Fields["Codename"] = ""; Fields["Date"] = datestr; + Fields["Valid-Until"] = validstr; Fields["Architectures"] = ""; Fields["Components"] = ""; Fields["Description"] = ""; |