From patchwork Sat Mar 25 16:34:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luke Shumaker X-Patchwork-Id: 72 Return-Path: Delivered-To: patchwork@archlinux.org Received: from nymeria.archlinux.org by nymeria.archlinux.org (Dovecot) with LMTP id AbkkIjuc1lgDMgAAtiB/HQ for ; Sat, 25 Mar 2017 17:35:07 +0100 Received: from nymeria.archlinux.org (localhost.localdomain [127.0.0.1]) by nymeria.archlinux.org (Postfix) with ESMTP id BF79D406FB; Sat, 25 Mar 2017 17:35:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on nymeria.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.5 tests=BAYES_00,RCVD_IN_DNSWL_MED shortcircuit=no autolearn=unavailable autolearn_force=no version=3.4.1 Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by nymeria.archlinux.org (Postfix) with ESMTPS; Sat, 25 Mar 2017 17:35:06 +0100 (CET) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 4936D213EB; Sat, 25 Mar 2017 16:35:06 +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 487A521411 for ; Sat, 25 Mar 2017 16:35:03 +0000 (UTC) Received: from mav.lukeshu.com (team4272.com [IPv6:2001:19f0:5c00:8069:5400:ff:fe26:6a86]) by luna.archlinux.org (Postfix) with ESMTPS for ; Sat, 25 Mar 2017 16:35:03 +0000 (UTC) Received: from build64-par (unknown [IPv6:2601:803:202:9275:21f:e2ff:fe4d:191b]) by mav.lukeshu.com (Postfix) with ESMTPSA id 28ECE83EAC; Sat, 25 Mar 2017 12:35:02 -0400 (EDT) From: Luke Shumaker To: arch-projects@lists.archlinux.org Date: Sat, 25 Mar 2017 12:34:40 -0400 Message-Id: <20170325163441.28555-4-lukeshu@parabola.nu> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170325163441.28555-1-lukeshu@parabola.nu> References: <20170325163441.28555-1-lukeshu@parabola.nu> Subject: [arch-projects] [devtools] [PATCH 3/4] lib/common.sh: lock, slock: Create directories for locks if necessary. X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.23 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 Cc: Luke Shumaker Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" X-UID: 200 Status: X-Keywords: Content-Length: 591 --- lib/common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/common.sh b/lib/common.sh index 63b7795..6d873ed 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -140,6 +140,7 @@ get_full_version() { lock() { # Only reopen the FD if it wasn't handed to us if ! [[ "/dev/fd/$1" -ef "$2" ]]; then + mkdir -p -- "$(dirname -- "$2")" eval "exec $1>"'"$2"' fi @@ -156,6 +157,7 @@ lock() { slock() { # Only reopen the FD if it wasn't handed to us if ! [[ "/dev/fd/$1" -ef "$2" ]]; then + mkdir -p -- "$(dirname -- "$2")" eval "exec $1>"'"$2"' fi