// SourcesWriter::DoPackage - Process a single package /*{{{*/
static std::string getDscHash(unsigned int const DoHashes,
Hashes::SupportedHashes const DoIt, pkgTagSection &Tags, char const * const FieldName,
// SourcesWriter::DoPackage - Process a single package /*{{{*/
static std::string getDscHash(unsigned int const DoHashes,
Hashes::SupportedHashes const DoIt, pkgTagSection &Tags, char const * const FieldName,
AddPattern("md5sum.txt");
}
AddPatterns(_config->FindVector("APT::FTPArchive::Release::Patterns"));
time_t const now = time(NULL);
AddPattern("md5sum.txt");
}
AddPatterns(_config->FindVector("APT::FTPArchive::Release::Patterns"));
time_t const now = time(NULL);
- setlocale(LC_TIME, "C");
-
- char datestr[128];
- if (strftime(datestr, sizeof(datestr), "%a, %d %b %Y %H:%M:%S UTC",
- gmtime(&now)) == 0)
- {
- datestr[0] = '\0';
- }
+ // FIXME: use TimeRFC1123 here? But that uses GMT to satisfy HTTP/1.1
+ std::ostringstream datestr;
+ datestr.imbue(posix);
+ datestr << std::put_time(gmtime(&now), "%a, %d %b %Y %H:%M:%S UTC");
- char validstr[128];
- if (now == validuntil ||
- strftime(validstr, sizeof(validstr), "%a, %d %b %Y %H:%M:%S UTC",
- gmtime(&validuntil)) == 0)
+ std::ostringstream validstr;
+ if (validuntil != now)
Fields["Architectures"] = "";
Fields["Components"] = "";
Fields["Description"] = "";
Fields["Architectures"] = "";
Fields["Components"] = "";
Fields["Description"] = "";
if (_config->FindB("APT::FTPArchive::DoByHash", false) == true)
Fields["Acquire-By-Hash"] = "true";
if (_config->FindB("APT::FTPArchive::DoByHash", false) == true)
Fields["Acquire-By-Hash"] = "true";