From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9CDF713838B for ; Wed, 10 Sep 2014 20:35:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 39349E0869; Wed, 10 Sep 2014 20:35:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 618A9E086A for ; Wed, 10 Sep 2014 20:35:51 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 49E8933EAF3 for ; Wed, 10 Sep 2014 20:35:50 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F378B52B9 for ; Wed, 10 Sep 2014 20:35:48 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1410378768.dbacb3edd62cf3e30a3635c92c5582a7d754bf35.vapier@gentoo> Subject: [gentoo-commits] proj/releng:master commit in: tools/ X-VCS-Repository: proj/releng X-VCS-Files: tools/catalyst-auto X-VCS-Directories: tools/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: dbacb3edd62cf3e30a3635c92c5582a7d754bf35 X-VCS-Branch: master Date: Wed, 10 Sep 2014 20:35:48 +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-Archives-Salt: 3ab8e9ba-c60e-45d7-aecf-39e587853d81 X-Archives-Hash: f15571ccd2d3f924609e1ddeec6afd9c commit: dbacb3edd62cf3e30a3635c92c5582a7d754bf35 Author: Mike Frysinger gentoo org> AuthorDate: Wed Sep 10 19:52:48 2014 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Wed Sep 10 19:52:48 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=dbacb3ed catalyst-auto: construct tempdir with mktemp rather than pid This way we can sanely use pid namespaces without tempdirs clashing. --- tools/catalyst-auto | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/tools/catalyst-auto b/tools/catalyst-auto index 3aa98b2..ebdb7c7 100755 --- a/tools/catalyst-auto +++ b/tools/catalyst-auto @@ -1,4 +1,6 @@ #!/bin/bash +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 # First let's get our own mount namespace to avoid leaking crap. if [[ -z ${UNSHARE} ]] ; then @@ -8,8 +10,6 @@ if [[ -z ${UNSHARE} ]] ; then fi unset UNSHARE -PID=$$ - config_file= verbose=0 keep_tmpdir=0 @@ -118,7 +118,7 @@ fi source ${config_file} -TMPDIR=${TMP_PATH:-/tmp}/catalyst-auto.${PID} +TMPDIR=$(mktemp -d --tmpdir="${TMP_PATH:-/tmp}" catalyst-auto.XXXXXX) DATESTAMP=$(date +%Y%m%d) if [ ${verbose} = 1 ]; then @@ -126,21 +126,11 @@ if [ ${verbose} = 1 ]; then echo "DATESTAMP = ${DATESTAMP}" fi -# Check if tmp directory exists and remove it -if [ -d "${TMPDIR}" ]; then - if ! rm -rf "${TMPDIR}"; then - echo "Couldn't remove stale tmpdir ${TMPDIR}!" - exit 1 - fi +if ! mkdir -p "${TMPDIR}"/{specs,kconfig,log}; then + echo "Couldn't create tempdirs!" + exit 1 fi -for i in ${TMPDIR} ${TMPDIR}/specs ${TMPDIR}/kconfig ${TMPDIR}/log; do - if ! mkdir -p "${i}"; then - echo "Couldn't create dir ${i}!" - exit 1 - fi -done - if ! run_cmd "pre_build" "${TMPDIR}/log/pre_build.log"; then send_email "Catalyst build error - pre_build" "Your pre_build function sucks" "${TMPDIR}/log/pre_build.log" exit 1