From 11694c6d0bc3cdabf2bfeb9acc0f0a810ac1667f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 31 Jan 2024 10:20:19 +0000 Subject: scripts/import_*: update usage to include lei tips 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 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'scripts/import_maildir') 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 and all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ -# -# 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; -- cgit v1.2.3-24-ge0c7