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 A3852138334 for ; Sat, 6 Apr 2019 18:56:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8976AE087B; Sat, 6 Apr 2019 18:56:39 +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 6612FE087B for ; Sat, 6 Apr 2019 18:56:39 +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 2A406335CF3 for ; Sat, 6 Apr 2019 18:56:38 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C553944B for ; Sat, 6 Apr 2019 18:56:36 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1554576810.2d5c1dc73b2c44200e7bbb0ebb18a46adcc63af1.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_cmdline.sh genkernel X-VCS-Directories: / X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 2d5c1dc73b2c44200e7bbb0ebb18a46adcc63af1 X-VCS-Branch: master Date: Sat, 6 Apr 2019 18:56:36 +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: a33db77f-3cb6-4cdc-9ad0-5844f3a7a61a X-Archives-Hash: 41251103597583105364d1f72e51c4de commit: 2d5c1dc73b2c44200e7bbb0ebb18a46adcc63af1 Author: Thomas Deutschmann gentoo org> AuthorDate: Sat Apr 6 18:53:30 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Sat Apr 6 18:53:30 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=2d5c1dc7 Fix "Make sure $TMPDIR exists" Previous attempt to ensure $TMPDIR exists introduced a new bug: The used one-line if clause was invalid. Signed-off-by: Thomas Deutschmann gentoo.org> gen_cmdline.sh | 6 +++++- genkernel | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gen_cmdline.sh b/gen_cmdline.sh index c5697e2..be04cdb 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -587,8 +587,12 @@ parse_cmdline() { ;; --tempdir=*) TMPDIR="${*#*=}" - [ ! -d "${TMPDIR}" ] && mkdir -p "${TMPDIR}" || gen_die "Failed to create '${TMPDIR}'!" + if [ ! -d "${TMPDIR}" ] + then + mkdir -p "${TMPDIR}" || gen_die "Failed to create '${TMPDIR}'!" + fi TEMP=$(mktemp -d -p "${TMPDIR}" gk.XXXXXXXX) + [ -z "${TEMP}" ] && gen_die "mktemp failed!" print_info 2 "TMPDIR: ${TMPDIR}" print_info 2 "TEMP: ${TEMP}" ;; diff --git a/genkernel b/genkernel index 6904ff2..5337833 100755 --- a/genkernel +++ b/genkernel @@ -44,8 +44,13 @@ source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_mod source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -[ ! -d "${TMPDIR}" ] && mkdir -p "${TMPDIR}" || gen_die "Failed to create '${TMPDIR}'!" +if [ ! -d "${TMPDIR}" ] +then + mkdir -p "${TMPDIR}" || gen_die "Failed to create '${TMPDIR}'!" +fi + TEMP=$(mktemp -d -p "${TMPDIR}" gk.XXXXXXXX) +[ -z "${TEMP}" ] && gen_die "mktemp failed!" trap_cleanup(){ # Call exit code of 1 for failure