summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-06-08 22:55:42 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-06-08 22:55:42 +0200
commit0323317c08c0b08bf0ba1ac37a37a8de333cdb40 (patch)
tree30362e9c9952d785056ee278a09ccd54954a7853 /apt-pkg/acquire-item.cc
parentcd8cf88f0e64e222e9fdcbf86e6cbbe09306040e (diff)
enhance the Valid-Until code a bit by using the correct RFC1123StrToTime
method and allow for better translations of the error messages
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 4a846804e..ac84c2e5e 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1178,13 +1178,15 @@ bool pkgAcqMetaIndex::VerifyVendor(string Message) /*{{{*/
Transformed = "";
}
- if (_config->FindB("Acquire::Check-Valid-Until", true)) {
- if (MetaIndexParser->GetValidUntil() > 0 &&
- time(NULL) > MetaIndexParser->GetValidUntil()) {
- return _error->Error(_("Release file expired, ignoring %s (valid until %s)"),
- RealURI.c_str(),
- TimeRFC1123(MetaIndexParser->GetValidUntil()).c_str());
- }
+ if (_config->FindB("Acquire::Check-Valid-Until", true) == true &&
+ MetaIndexParser->GetValidUntil() > 0) {
+ time_t const invalid_since = time(NULL) - MetaIndexParser->GetValidUntil();
+ if (invalid_since > 0)
+ // TRANSLATOR: The first %s is the URL of the bad Release file, the second is
+ // the time since then the file is invalid - formated in the same way as in
+ // the download progress display (e.g. 7d 3h 42min 1s)
+ return _error->Error(_("Release file expired, ignoring %s (invalid since %s)"),
+ RealURI.c_str(), TimeToStr(invalid_since).c_str());
}
if (_config->FindB("Debug::pkgAcquire::Auth", false))