summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-05-28 11:03:35 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-05-28 11:42:20 +0200
commit9febc2b238e1e322dce1f94ecbed46d595893b52 (patch)
tree38137e0585535cb11c4d21d619c612b25609ed7a /test/integration
parentb58e2c7c56b1416a343e81f9f80cb1f02c128e25 (diff)
accept only the expected UTC timezones in date parsing
HTTP/1.1 hardcodes GMT (RFC 7231 §7.1.1.1) and what is good enough for the internet must be good enough for us™ as we reuse the implementation internally to parse (most) dates we encounter in various places like the Release files with their Date and Valid-Until header fields. Implementing a fully timezone aware parser just feels too hard for no effective benefit as it would take 5+ years (= until LTS's are out of fashion) until a repository could use non-UTC dates and expect it to work. Not counting non-apt implementations which might or might not only want to encounter UTC here as well. As a bonus, this eliminates the use of an instance of setlocale in libapt. Closes: 819697
Diffstat (limited to 'test/integration')
-rwxr-xr-xtest/integration/test-apt-update-ims4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/integration/test-apt-update-ims b/test/integration/test-apt-update-ims
index e1ffd5240..f118f7c11 100755
--- a/test/integration/test-apt-update-ims
+++ b/test/integration/test-apt-update-ims
@@ -95,9 +95,9 @@ runtest 'warning'
# make the release file old
find aptarchive -name '*Release' -exec sed -i \
- -e "s#^Date: .*\$#Date: $(date -d '-2 weeks' '+%a, %d %b %Y %H:%M:%S %Z')#" \
+ -e "s#^Date: .*\$#Date: $(date -ud '-2 weeks' '+%a, %d %b %Y %H:%M:%S %Z')#" \
-e '/^Valid-Until: / d' -e "/^Date: / a\
-Valid-Until: $(date -d '-1 weeks' '+%a, %d %b %Y %H:%M:%S %Z')" '{}' \;
+Valid-Until: $(date -ud '-1 weeks' '+%a, %d %b %Y %H:%M:%S %Z')" '{}' \;
signreleasefiles
msgmsg 'expired InRelease'