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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 205A7159C9B for ; Sun, 11 Aug 2024 10:11:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 911482BC0AB; Sun, 11 Aug 2024 10:11:14 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7C2602BC0AB for ; Sun, 11 Aug 2024 10:11:14 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 672B7343124 for ; Sun, 11 Aug 2024 10:11:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 777561EE9 for ; Sun, 11 Aug 2024 10:11:10 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1723371060.2f32e4a026a1d45bfc8223f55bb8913f2d455ec5.sam@gentoo> Subject: [gentoo-commits] proj/gentoo-functions:master commit in: / X-VCS-Repository: proj/gentoo-functions X-VCS-Files: test-functions X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 2f32e4a026a1d45bfc8223f55bb8913f2d455ec5 X-VCS-Branch: master Date: Sun, 11 Aug 2024 10:11:10 +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: 4d9217f3-f4a7-4e10-8a20-b68fea682ea4 X-Archives-Hash: c2d4d8d4396a8df3b264a970f353830a commit: 2f32e4a026a1d45bfc8223f55bb8913f2d455ec5 Author: Kerin Millar plushkava net> AuthorDate: Thu Aug 8 09:28:03 2024 +0000 Commit: Sam James gentoo org> CommitDate: Sun Aug 11 10:11:00 2024 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=2f32e4a0 test-functions: choose a better variable name for storing the temp dir The name, dir, is rather generic. Rename it to global_tmpdir to diminish the likelihood of an accidental name space conflict. Also, don't pass the -f option to rm(1) at the point that the directory is to be removed. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> test-functions | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test-functions b/test-functions index 275d32f..1f54208 100755 --- a/test-functions +++ b/test-functions @@ -12,14 +12,14 @@ bailout() { } assign_tmpdir() { - dir=$(mktemp -d) \ - && chdir "${dir}" \ + global_tmpdir=$(mktemp -d) \ + && chdir "${global_tmpdir}" \ || bailout "Couldn't create or change to the temp dir" } cleanup_tmpdir() { - if [ -n "${dir}" ]; then - rm -rf -- "${dir}" + if [ "${global_tmpdir}" ]; then + rm -r -- "${global_tmpdir}" fi } @@ -1103,7 +1103,7 @@ iterate_tests() { printf 'TAP version 13\n' -unset -v dir +unset -v global_tmpdir # PATH is redefined to prevent ebuild-helpers such as die from interfering. export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/pkg/bin