From: Ricardo Ribalda <ricardo@ribalda.com>
To: meta@public-inbox.org
Cc: Ricardo Ribalda <ricardo@ribalda.com>
Subject: [PATCH] Gcf2: Create cache folder if missing
Date: Thu, 8 Sep 2022 21:57:31 +0200 [thread overview]
Message-ID: <20220908195731.174883-1-ricardo@ribalda.com> (raw)
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 <ricardo@ribalda.com>
---
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
next reply other threads:[~2022-09-08 19:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-08 19:57 Ricardo Ribalda [this message]
2022-09-08 22:08 ` [PATCH] Gcf2: Create cache folder if missing Eric Wong
2022-09-09 10:10 ` Ricardo Ribalda Delgado
2022-12-23 22:11 ` [PATCH] cleanup pure Perl use Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220908195731.174883-1-ricardo@ribalda.com \
--to=ricardo@ribalda.com \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).