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 0/5] more MH-related updates
@ 2024-01-31 10:20  7% Eric Wong
  2024-01-31 10:20  5% ` [PATCH 4/5] scripts/import_*: update usage to include lei tips Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2024-01-31 10:20 UTC (permalink / raw)
  To: meta

MH can be for slrnpull (and presumably many other NNTP) spools,
too.  I'm thinking 5/5 is a nice quality-of-life improvement
since I didn't want to document --sort=sequence in all the
updated scripts/import_*

Eric Wong (5):
  lei convert: explicitly allow --sort for inputs
  import: drop redundant `use' statement
  scripts/slrnspool2maildir: use MHreader and LeiToMail
  scripts/import_*: update usage to include lei tips
  lei: sort MH inputs sequentially by default

 lib/PublicInbox/Import.pm     |  1 -
 lib/PublicInbox/LeiConvert.pm |  1 +
 lib/PublicInbox/LeiInput.pm   |  2 +-
 lib/PublicInbox/LeiToMail.pm  |  2 +
 lib/PublicInbox/MHreader.pm   |  3 +-
 scripts/import_maildir        | 20 +++++---
 scripts/import_slrnspool      | 26 ++++++----
 scripts/import_vger_from_mbox |  6 +--
 scripts/slrnspool2maildir     | 90 ++++++++++++++++++-----------------
 t/mh_reader.t                 | 15 +++++-
 10 files changed, 102 insertions(+), 64 deletions(-)

^ permalink raw reply	[relevance 7%]

* [PATCH 4/5] scripts/import_*: update usage to include lei tips
  2024-01-31 10:20  7% [PATCH 0/5] more MH-related updates Eric Wong
@ 2024-01-31 10:20  5% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2024-01-31 10:20 UTC (permalink / raw)
  To: meta

These scripts probably don't offer anything useful now that
lei has fleshed out read-only MH support and v2 outputs.
---
 scripts/import_maildir        | 20 ++++++++++++++------
 scripts/import_slrnspool      | 26 ++++++++++++++++++--------
 scripts/import_vger_from_mbox |  6 +++---
 3 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/scripts/import_maildir b/scripts/import_maildir
index 269f2550..7228a3ad 100755
--- a/scripts/import_maildir
+++ b/scripts/import_maildir
@@ -1,21 +1,29 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2014, Eric Wong <e@80x24.org> and all contributors
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
-#
-# Script to import a Maildir into a public-inbox
 =begin usage
+Ancient script to import a Maildir into a v1 public-inbox
+
+	# this is only if you want a v1 inbox
 	export GIT_DIR=/path/to/your/repo.git
 	export GIT_AUTHOR_EMAIL='list@example.com'
 	export GIT_AUTHOR_NAME='list name'
 	./import_maildir /path/to/maildir/
+
+For v2 (strongly recommended), use:
+
+	lei convert /path/to/maildir -o /path/to/v2-inbox
+	# (and `lei daemon-kill' if you don't want the daemon to linger)
 =cut
-use strict;
-use warnings;
+use v5.12;
 use Date::Parse qw/str2time/;
 use PublicInbox::Eml;
 use PublicInbox::Git;
 use PublicInbox::Import;
-sub usage { "Usage:\n".join('', grep(/\t/, `head -n 24 $0`)) }
+sub usage {
+	open my $fh, '<', __FILE__;
+	("Usage:\n", grep { /^=begin usage/../^=cut/ and !/^=/m } <$fh>);
+}
 my $dir = shift @ARGV or die usage();
 my $git_dir = `git rev-parse --git-dir`;
 chomp $git_dir;
diff --git a/scripts/import_slrnspool b/scripts/import_slrnspool
index d9a35dfd..81df6c2e 100755
--- a/scripts/import_slrnspool
+++ b/scripts/import_slrnspool
@@ -1,20 +1,30 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2015-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
-#
-# Incremental (or one-shot) importer of a slrnpull news spool
 =begin usage
+Incremental (or one-shot) importer of a slrnpull news spool.
+
+Since the news spool can appear as an MH folder, you may also use
+lei from public-inbox 2.0+ to convert it:
+
+	lei convert mh:$SLRNPULL_ROOT/news/foo/bar -o v2:/path/to/inbox/
+	# (and `lei daemon-kill' if you don't want the daemon to linger)
+
+But if you want to use this script:
+
 	export ORIGINAL_RECIPIENT=address@example.com
-	public-inbox-init $INBOX $GIT_DIR $HTTP_URL $ORIGINAL_RECIPIENT
-	./import_slrnspool SLRNPULL_ROOT/news/foo/bar
+	public-inbox-init -V2 $INBOX $INBOX_DIR $HTTP_URL $ORIGINAL_RECIPIENT
+	./import_slrnspool $SLRNPULL_ROOT/news/foo/bar
 =cut
-use strict;
-use warnings;
+use v5.12;
 use PublicInbox::Config;
 use PublicInbox::Eml;
 use PublicInbox::Import;
 use PublicInbox::Git;
-sub usage { "Usage:\n".join('',grep(/\t/, `head -n 10 $0`)) }
+sub usage {
+	open my $fh, '<', __FILE__;
+	("Usage:\n", grep { /^=begin usage/../^=cut/ and !/^=/m } <$fh>);
+}
 my $exit = 0;
 my $sighandler = sub { $exit = 1 };
 $SIG{INT} = $sighandler;
diff --git a/scripts/import_vger_from_mbox b/scripts/import_vger_from_mbox
index c33e42e4..40ccf50b 100644
--- a/scripts/import_vger_from_mbox
+++ b/scripts/import_vger_from_mbox
@@ -1,8 +1,8 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2016-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
-use strict;
-use warnings;
+# consider `lei convert' instead since it handles more formats
+use v5.12;
 use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
 use PublicInbox::InboxWritable;
 my $usage = "usage: $0 NAME EMAIL DIR <MBOX\n";

^ permalink raw reply related	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2024-01-31 10:20  7% [PATCH 0/5] more MH-related updates Eric Wong
2024-01-31 10:20  5% ` [PATCH 4/5] scripts/import_*: update usage to include lei tips 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).