From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 70B91138334 for ; Sun, 5 May 2019 05:20:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F0F82E0848; Sun, 5 May 2019 05:20:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C815CE0844 for ; Sun, 5 May 2019 05:20:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3F0333435F9 for ; Sun, 5 May 2019 05:20:20 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E4FD4449 for ; Sun, 5 May 2019 05:20:14 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1557033587.d264d488bf1dcb52c562b37afdc11b9cc11a5b03.robbat2@gentoo> Subject: [gentoo-commits] proj/qa-scripts:master commit in: / X-VCS-Repository: proj/qa-scripts X-VCS-Files: keyrings.inc.bash X-VCS-Directories: / X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: d264d488bf1dcb52c562b37afdc11b9cc11a5b03 X-VCS-Branch: master Date: Sun, 5 May 2019 05:20:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f4a23476-738f-4cf8-b4c7-ac0595baf46a X-Archives-Hash: 7a7d6369c728fe0eda0fa089e995c631 commit: d264d488bf1dcb52c562b37afdc11b9cc11a5b03 Author: Robin H. Johnson gentoo org> AuthorDate: Sun May 5 05:19:47 2019 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Sun May 5 05:19:47 2019 +0000 URL: https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=d264d488 keyrings: fix cleanup bug Signed-off-by: Robin H. Johnson gentoo.org> keyrings.inc.bash | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/keyrings.inc.bash b/keyrings.inc.bash index 2b5ad9a..a3879d5 100644 --- a/keyrings.inc.bash +++ b/keyrings.inc.bash @@ -69,8 +69,11 @@ clean_tmp() { [ -n "$GPG_TMPDIR" ] && [ -d "$GPG_TMPDIR" ] && rm -rf "$GPG_TMPDIR" } setup_tmp() { - GPG_TMPDIR=$(mktemp -d) - trap clean_tmp EXIT + if [ -z "${GPG_TMPDIR}" ]; then + GPG_TMPDIR=$(mktemp -d) + export GPG_TMPDIR + trap clean_tmp EXIT + fi } export_keys() { @@ -104,6 +107,8 @@ export_keys() { mv -f "${TMP}" "${DST}" mv -f "${TMP}.packets.txt" "${DST}.packets.txt" fi + # Cleanup anyway + rm -f "${TMP}.packets.txt" "${TMP}" } # populate common variables