about summary refs log tree commit homepage
path: root/scripts/import_slrnspool
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2024-01-31 10:20:19 +0000
committerEric Wong <e@80x24.org>2024-02-01 21:00:16 +0000
commit11694c6d0bc3cdabf2bfeb9acc0f0a810ac1667f (patch)
treec1e418e4cd03666731946c40a27f081394e0ef53 /scripts/import_slrnspool
parentc258f758b05449c83ac2765084a872c74eb51fc2 (diff)
downloadpublic-inbox-11694c6d0bc3cdabf2bfeb9acc0f0a810ac1667f.tar.gz
These scripts probably don't offer anything useful now that
lei has fleshed out read-only MH support and v2 outputs.
Diffstat (limited to 'scripts/import_slrnspool')
-rwxr-xr-xscripts/import_slrnspool26
1 files changed, 18 insertions, 8 deletions
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;