From patchwork Wed Mar 14 01:52:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luke Shumaker X-Patchwork-Id: 457 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 122F926EBC2D for ; Wed, 14 Mar 2018 01:52:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Wed, 14 Mar 2018 01:52:50 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 629CF967281C8; Wed, 14 Mar 2018 01:52:43 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Wed, 14 Mar 2018 01:52:28 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 750F12CD7A; Wed, 14 Mar 2018 01:52:16 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=none Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id DB9CF2C460 for ; Wed, 14 Mar 2018 01:52:14 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Wed, 14 Mar 2018 01:52:14 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id E928596728116 for ; Wed, 14 Mar 2018 01:52:07 +0000 (UTC) Received: from mav.lukeshu.com (mav.lukeshu.com [104.207.138.63]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Wed, 14 Mar 2018 01:52:07 +0000 (UTC) Received: from build64-par (unknown [IPv6:2601:803:202:9275:da50:e6ff:fe00:4a5b]) by mav.lukeshu.com (Postfix) with ESMTPSA id DCAC780505 for ; Tue, 13 Mar 2018 21:52:06 -0400 (EDT) From: Luke Shumaker To: arch-projects@archlinux.org Date: Tue, 13 Mar 2018 21:52:00 -0400 Message-Id: <20180314015205.20781-4-lukeshu@lukeshu.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180314015205.20781-1-lukeshu@lukeshu.com> References: <20180314015205.20781-1-lukeshu@lukeshu.com> Subject: [arch-projects] [dbscripts] [PATCH 3/8] Export TMPDIR, and use mktemp -t instead of making it part of the template X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Arch Linux projects development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Arch Linux projects development discussion Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" From: Luke Shumaker --- config | 2 +- db-functions | 2 +- test/cases/db-update.bats | 2 +- test/lib/common.bash | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config b/config index 02ade09..2f5dbc6 100644 --- a/config +++ b/config @@ -21,7 +21,7 @@ LOCK_DELAY=10 LOCK_TIMEOUT=300 STAGING="$HOME/staging" -TMPDIR="/var/tmp" +export TMPDIR="/var/tmp" ARCHES=(x86_64) DBEXT=".db.tar.gz" FILESEXT=".files.tar.gz" diff --git a/db-functions b/db-functions index 2703e80..58b753a 100644 --- a/db-functions +++ b/db-functions @@ -38,7 +38,7 @@ mv_acl() { } # set up general environment -WORKDIR=$(mktemp -d "${TMPDIR}/${0##*/}.XXXXXXXXXX") +WORKDIR=$(mktemp -dt "${0##*/}.XXXXXXXXXX") if [[ -n ${SVNUSER} ]]; then setfacl -m u:"${SVNUSER}":rwx "${WORKDIR}" setfacl -m d:u:"${USER}":rwx "${WORKDIR}" diff --git a/test/cases/db-update.bats b/test/cases/db-update.bats index e7e4489..2e44b91 100644 --- a/test/cases/db-update.bats +++ b/test/cases/db-update.bats @@ -222,7 +222,7 @@ load ../lib/common @test "package has to be aregular file" { local p - local target=$(mktemp -d) + local target=$(mktemp -dt) local arches=('i686' 'x86_64') releasePackage extra 'pkg-simple-a' diff --git a/test/lib/common.bash b/test/lib/common.bash index 568a541..45e4800 100644 --- a/test/lib/common.bash +++ b/test/lib/common.bash @@ -83,7 +83,7 @@ setup() { local a PKGEXT=".pkg.tar.xz" - TMP="$(mktemp -d)" + TMP="$(mktemp -dt)" export DBSCRIPTS_CONFIG=${TMP}/config.local cat < "${DBSCRIPTS_CONFIG}"