summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--methods/gpgv.cc2
-rwxr-xr-xtest/integration/test-signed-by-option5
2 files changed, 6 insertions, 1 deletions
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index b8d348484..267b43e08 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -482,7 +482,7 @@ bool GPGVMethod::URIAcquire(std::string const &Message, FetchItem *Itm)
struct TemporaryFile
{
std::string name = "";
- ~TemporaryFile() { if (0) RemoveFile("~TemporaryFile", name); }
+ ~TemporaryFile() { RemoveFile("~TemporaryFile", name); }
} tmpKey;
std::string SignedBy = DeQuoteString(LookupTag(Message, "Signed-By"));
diff --git a/test/integration/test-signed-by-option b/test/integration/test-signed-by-option
index 986088bce..58e4c4b19 100755
--- a/test/integration/test-signed-by-option
+++ b/test/integration/test-signed-by-option
@@ -7,6 +7,9 @@ TESTDIR="$(readlink -f "$(dirname "$0")")"
setupenvironment
configarchitecture 'amd64'
+export TMPDIR="${TMPWORKINGDIRECTORY}/tmp"
+mkdir "${TMPDIR}"
+
msgtest 'Check that a repository with' 'signed-by and two components works'
echo 'deb [signed-by=CDE5618B8805FD6E202CE9C2D73C39E56580B386] https://people.debian.org/~jak/debian/ stable main contrib # Äffchen' > rootdir/etc/apt/sources.list
testsuccess --nomsg aptcache policy
@@ -66,3 +69,5 @@ testfailure apt update -o Debug::Acquire::gpgv=1
testsuccess grep "NO_PUBKEY 5A90D141DBAC8DAE" rootdir/tmp/testfailure.output
sed -i s/^xSigned-By/Signed-By/ rootdir/etc/apt/sources.list.d/deb822.sources
testsuccess apt update -o Debug::Acquire::gpgv=1
+# make sure we did not leave leftover files (LP: #1995247)
+testsuccessequal "" ls "${TMPDIR}"