diff options
author | Ricardo Ribalda <ricardo@ribalda.com> | 2022-09-08 21:57:31 +0200 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2022-09-08 21:28:28 +0000 |
commit | ad8acf7d6484d0a489499742cadadbd4f890ab53 (patch) | |
tree | 5a627446226895d34953337fe604c2dd5cfbfc8f | |
parent | 2dac8623e41bee83f1861608e708b33696c7d189 (diff) | |
download | public-inbox-ad8acf7d6484d0a489499742cadadbd4f890ab53.tar.gz |
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>
-rw-r--r-- | lib/PublicInbox/Gcf2.pm | 2 |
1 files changed, 2 insertions, 0 deletions
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): $!"; |