Browse Source

* ftparchive/writer.cc:

- add ValidTime option to generate a Valid-Until header in Release file
tags/debian/0.8.0
David Kalnischkies 11 years ago
parent
commit
c99e48ec26
3 changed files with 14 additions and 1 deletions
  1. +2
    -0
      debian/changelog
  2. +2
    -1
      doc/apt-ftparchive.1.xml
  3. +10
    -0
      ftparchive/writer.cc

+ 2
- 0
debian/changelog View File

@@ -47,6 +47,8 @@ apt (0.7.26~exp5) experimental; urgency=low
* apt-pkg/contrib/strutl.cc:
- split StrToTime() into HTTP1.1 and FTP date parser methods and
use strptime() instead of some selfmade scanf mangling
* ftparchive/writer.cc:
- add ValidTime option to generate a Valid-Until header in Release file

[ Michael Vogt ]
* methods/http.{cc,h}:


+ 2
- 1
doc/apt-ftparchive.1.xml View File

@@ -122,7 +122,8 @@
e.g. <literal>APT::FTPArchive::Release::Origin</literal>. The supported fields
are: <literal>Origin</literal>, <literal>Label</literal>, <literal>Suite</literal>,
<literal>Version</literal>, <literal>Codename</literal>, <literal>Date</literal>,
<literal>Architectures</literal>, <literal>Components</literal>, <literal>Description</literal>.</para></listitem>
<literal>Valid-Until</literal>, <literal>Architectures</literal>,
<literal>Components</literal>, <literal>Description</literal>.</para></listitem>

</varlistentry>



+ 10
- 0
ftparchive/writer.cc View File

@@ -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"] = "";


Loading…
Cancel
Save