about summary refs log tree commit homepage
path: root/scripts/import_vger_from_mbox
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-02-17 10:19:47 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-02-19 20:10:41 +0000
commitff25a60b1b85c92a7e76a735a2c79c0205233a27 (patch)
treefda9bf18b9772637baaadbfbe094169cbf5800a7 /scripts/import_vger_from_mbox
parent5a6bdba5bf610145f26243e73cd349658d2e2db9 (diff)
downloadpublic-inbox-ff25a60b1b85c92a7e76a735a2c79c0205233a27.tar.gz
Wrap the old Import package to enable creating new repos based
on size thresholds.  This is better than relying on time-based
rotation as LKML traffic seems to be increasing.
Diffstat (limited to 'scripts/import_vger_from_mbox')
-rw-r--r--scripts/import_vger_from_mbox19
1 files changed, 9 insertions, 10 deletions
diff --git a/scripts/import_vger_from_mbox b/scripts/import_vger_from_mbox
index 6ea2ca5d..c45dc4ee 100644
--- a/scripts/import_vger_from_mbox
+++ b/scripts/import_vger_from_mbox
@@ -7,25 +7,24 @@ use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
 use Date::Parse qw/str2time/;
 use Email::MIME;
 $Email::MIME::ContentType::STRICT_PARAMS = 0; # user input is imperfect
-use PublicInbox::Git;
-use PublicInbox::Import;
-my $usage = "usage: $0 NAME EMAIL <MBOX\n";
+use PublicInbox::V2Writable;
+my $usage = "usage: $0 NAME EMAIL DIR <MBOX\n";
 my $dry_run;
 my %opts = ( 'n|dry-run' => \$dry_run );
 GetOptions(%opts) or die $usage;
-chomp(my $git_dir = `git rev-parse --git-dir`);
-my $git = PublicInbox::Git->new($git_dir);
 my $name = shift or die $usage; # git
 my $email = shift or die $usage; # git@vger.kernel.org
-my $im = $dry_run ? undef : PublicInbox::Import->new($git, $name, $email);
+my $mainrepo = shift or die $usage; # /path/to/v2/repo
+my $v2ibx = {
+        mainrepo => $mainrepo,
+        name => $name,
+        -primary_address => $email,
+};
+my $im = $dry_run ? undef : PublicInbox::V2Writable->new($v2ibx, 1);
 binmode STDIN;
 my $msg = '';
 use PublicInbox::Filter::Vger;
 my $vger = PublicInbox::Filter::Vger->new;
-if ($im) {
-        $im->{ssoma_lock} = 0;
-        $im->{path_type} = 'v2';
-}
 
 sub do_add ($$) {
         my ($im, $msg) = @_;