user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 3/3] emergency: create full path to PI_EMERGENCY
  2020-07-29  8:43  5% [PATCH 0/3] test fixes Eric Wong
@ 2020-07-29  8:43  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-07-29  8:43 UTC (permalink / raw)
  To: meta

It's possible for ~/.public-inbox/ to not exist if PI_CONFIG
points to an alternate location.  Only noticed from the previous
patch fixing t/init.t behavior.
---
 lib/PublicInbox/Emergency.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/Emergency.pm b/lib/PublicInbox/Emergency.pm
index 02900bb1..b705e776 100644
--- a/lib/PublicInbox/Emergency.pm
+++ b/lib/PublicInbox/Emergency.pm
@@ -12,11 +12,13 @@ use IO::Handle; # ->flush, ->autoflush
 sub new {
 	my ($class, $dir) = @_;
 
-	-d $dir or mkdir($dir) or die "failed to mkdir($dir): $!\n";
 	foreach (qw(new tmp cur)) {
 		my $d = "$dir/$_";
 		next if -d $d;
-		-d $d or mkdir($d) or die "failed to mkdir($d): $!\n";
+		require File::Path;
+		if (!File::Path::mkpath($d) && !-d $d) {
+			die "failed to mkpath($d): $!\n";
+		}
 	}
 	bless { dir => $dir, files => {}, t => 0, cnt => 0, pid => $$ }, $class;
 }

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/3] test fixes
@ 2020-07-29  8:43  5% Eric Wong
  2020-07-29  8:43  7% ` [PATCH 3/3] emergency: create full path to PI_EMERGENCY Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-07-29  8:43 UTC (permalink / raw)
  To: meta

Some new features had tests which failed on new VMs.

Eric Wong (3):
  t/imap_searchqp: fix test dependencies
  t/init: fix test when ~/.public-inbox/ does not exist
  emergency: create full path to PI_EMERGENCY

 lib/PublicInbox/Emergency.pm | 6 ++++--
 t/imap_searchqp.t            | 3 ++-
 t/init.t                     | 4 ++++
 3 files changed, 10 insertions(+), 3 deletions(-)

^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-07-29  8:43  5% [PATCH 0/3] test fixes Eric Wong
2020-07-29  8:43  7% ` [PATCH 3/3] emergency: create full path to PI_EMERGENCY Eric Wong

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).