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 1/3] convert: use ProcessPipe with popen_rd
  2023-09-27  6:02  6% [PATCH 0/3] more process management cleanups + bugfix Eric Wong
@ 2023-09-27  6:02  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2023-09-27  6:02 UTC (permalink / raw)
  To: meta

ProcessPipe->CLOSE will already run waitpid for us and
exit on errors, so we can do less, here.
---
 script/public-inbox-convert | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/script/public-inbox-convert b/script/public-inbox-convert
index 96931cbf..780f7194 100755
--- a/script/public-inbox-convert
+++ b/script/public-inbox-convert
@@ -117,7 +117,7 @@ $clone may not be valid after migrating to v2, not copying
 }
 my $state = '';
 my $head = $old->{ref_head} || 'HEAD';
-my ($rd, $pid) = $old->git->popen(qw(fast-export --use-done-feature), $head);
+my $rd = $old->git->popen(qw(fast-export --use-done-feature), $head);
 $v2w->idx_init($opt);
 my $im = $v2w->importer;
 my ($r, $w) = $im->gfi_start;
@@ -164,9 +164,7 @@ while (<$rd>) {
 	last if $_ eq "done\n";
 	print $w $_ or $im->wfail;
 }
-close $rd or die "close fast-export: $!\n";
-waitpid($pid, 0) or die "waitpid failed: $!\n";
-$? == 0 or die "fast-export failed: $?\n";
+close $rd or die "fast-export: \$?=$? \$!=$!\n";
 $r = $w = undef; # v2w->done does the actual close and error checking
 $v2w->done;
 if (my $old_mm = $old->mm) {

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/3] more process management cleanups + bugfix
@ 2023-09-27  6:02  6% Eric Wong
  2023-09-27  6:02  7% ` [PATCH 1/3] convert: use ProcessPipe with popen_rd Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2023-09-27  6:02 UTC (permalink / raw)
  To: meta

3/3 is a bugfix found while working on this series, but probably
nobody noticed it...  The code reductions in lib/ are nice.

Eric Wong (3):
  convert: use ProcessPipe with popen_rd
  spawn: add popen_wr support
  lei: don't gzip --rsyncable by default for mbox*

 lib/PublicInbox/LEI.pm         |  3 ++-
 lib/PublicInbox/LeiRediff.pm   | 25 ++++++++++-------------
 lib/PublicInbox/LeiToMail.pm   |  9 +++------
 lib/PublicInbox/MboxReader.pm  | 36 ++++++++--------------------------
 lib/PublicInbox/ProcessPipe.pm |  9 +++++++++
 lib/PublicInbox/Spawn.pm       | 20 +++++++++----------
 script/public-inbox-convert    |  6 ++----
 t/lei-convert.t                | 27 +++++++++++++++++++++++--
 8 files changed, 68 insertions(+), 67 deletions(-)

^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2023-09-27  6:02  6% [PATCH 0/3] more process management cleanups + bugfix Eric Wong
2023-09-27  6:02  7% ` [PATCH 1/3] convert: use ProcessPipe with popen_rd 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).