From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Status: No, score=-2.7 required=3.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 43B5E1F54E for ; Thu, 8 Sep 2022 19:57:36 +0000 (UTC) Received: by mail-ej1-f51.google.com with SMTP id fy31so40591247ejc.6 for ; Thu, 08 Sep 2022 12:57:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=7C/mMY0lqwaKawbid/9lV0ju53eoztUmylfDdnadjrI=; b=nm7dHTT3i9BczUuUzCuCbb7yo5fshDcOk7MfVCDOrtPPJ8QKfyvuUdNfp3lER/Dve4 OKSNihseef3YWw9Kht0Hu7jVK0XmDeSJ68JJz4hVeLNm95mVtGX+U4mLmRB1YDpo+a72 CvP8C2iD5pTHYQG1wWnUuOgoEI33BUZFHkbx9eHuXmDXttOr/1z5PVD7klpQ+us1cBWm osNq8mOSLqJmJSvz2UJ823Y4gYTC8e+0EgyiJuGzt1ANhiluLRcRiclDdnzap1aNUJ9C gtWlZFK81P1eZhp+KrwG3eOx7c7wjwJil8UAo3DsaIrcA+EYOdACrHRDWmjDHM/YJE8g oSuQ== X-Gm-Message-State: ACgBeo1917ZxL0hXO79750EF/7pReLxgYFDwGhPcdg/6ldNhmTHmIUTY XIAzzXBTQl08fHkBA73zOiFawTVUMQs= X-Google-Smtp-Source: AA6agR7EGuBbzRZSL4mg0Q08jrJUZYHWdGtHzyW2GWVhgLYIh1hCoBwRCZVMD0EgZWm5i58INI5Zag== X-Received: by 2002:a17:907:6e14:b0:730:a229:f747 with SMTP id sd20-20020a1709076e1400b00730a229f747mr7613637ejc.202.1662667053850; Thu, 08 Sep 2022 12:57:33 -0700 (PDT) Received: from piling.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id h27-20020a056402095b00b0044eca6561adsm6062600edz.5.2022.09.08.12.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 12:57:33 -0700 (PDT) From: Ricardo Ribalda To: meta@public-inbox.org Cc: Ricardo Ribalda Subject: [PATCH] Gcf2: Create cache folder if missing Date: Thu, 8 Sep 2022 21:57:31 +0200 Message-Id: <20220908195731.174883-1-ricardo@ribalda.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: The code expects that the folder is already present, this patch creates it if missing. Without this path the test fails with: open(/home/debci/.cache/public-inbox/inline-c/.public-inbox.lock): No such file or directory at /usr/share/perl5/PublicInbox/Gcf2.pm line 20 Signed-off-by: Ricardo Ribalda --- lib/PublicInbox/Gcf2.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PublicInbox/Gcf2.pm b/lib/PublicInbox/Gcf2.pm index 41ee0715..02cd0de2 100644 --- a/lib/PublicInbox/Gcf2.pm +++ b/lib/PublicInbox/Gcf2.pm @@ -10,12 +10,14 @@ use PublicInbox::Spawn qw(which popen_rd); # may set PERL_INLINE_DIRECTORY use Fcntl qw(LOCK_EX SEEK_SET); use Time::HiRes qw(clock_gettime CLOCK_MONOTONIC); use IO::Handle; # autoflush +use File::Path qw(make_path); BEGIN { my (%CFG, $c_src); # PublicInbox::Spawn will set PERL_INLINE_DIRECTORY # to ~/.cache/public-inbox/inline-c if it exists my $inline_dir = $ENV{PERL_INLINE_DIRECTORY} // die 'PERL_INLINE_DIRECTORY not defined'; + make_path($inline_dir); my $f = "$inline_dir/.public-inbox.lock"; open my $fh, '+>', $f or die "open($f): $!"; -- 2.35.1