From 872bd447163066b331eb12c0fed0d71c0585f47b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 16 Feb 2016 15:35:36 +0100 Subject: deal with partially downloaded changelogs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changelogs are relatively small and we have no hashes for them, but we had partial support for them before, so lets stick to it. This also deletes the (partial) file before moving the downloaded file into its place – rename(2) should be doing this by itself, but testing on semaphoreci suggests that this isn't always the case (error is "Stale file handle") and we don't need an atomic replace here, so be explicit. Git-Dch: Ignore --- test/integration/test-apt-get-changelog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/integration/test-apt-get-changelog b/test/integration/test-apt-get-changelog index d65c9530e..1815b9961 100755 --- a/test/integration/test-apt-get-changelog +++ b/test/integration/test-apt-get-changelog @@ -94,9 +94,15 @@ testsuccess aptget changelog foo foo -d testfilestats 'foo.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" testfileequal 'foo.changelog' "$(cat aptarchive/pool/main/f/foo/foo_1.0/changelog)" echo 'bogus' > foo.changelog +touch -d 'now + 1 hour' foo.changelog testsuccess aptget changelog foo foo -d testfilestats 'foo.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" testfileequal 'foo.changelog' "$(cat aptarchive/pool/main/f/foo/foo_1.0/changelog)" +echo -n 'bogus' > foo.changelog +touch -d "$(stat -c%y aptarchive/pool/main/f/foo/foo_1.0/changelog)" foo.changelog +testsuccess aptget changelog foo foo -d +testfilestats 'foo.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" +testequal 'bogus1.0) stable; urgency=low' head -n 1 foo.changelog rm -f foo.changelog # no @CHANGEPATH@ in the URI -- cgit v1.2.3