From: Chris Nehren Date: Sun, 20 Jun 2010 04:12:55 +0000 (-0400) Subject: simple, stupid mailman -> pmg subscriber import X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e93133c754102001828fe572104327f7fe6aead5;p=p5sagit%2FPromulger.git simple, stupid mailman -> pmg subscriber import --- diff --git a/bin/mm2pmg b/bin/mm2pmg new file mode 100644 index 0000000..b167230 --- /dev/null +++ b/bin/mm2pmg @@ -0,0 +1,20 @@ +#!/usr/bin/perl +use strict; +use warnings; + +use Promulger::List; + +use IPC::Run3; + +@ARGV == 2 or die "usage: $0 mailman_list_name pmg_list_name"; +my ($mm_list_name, $pmg_list_name) = @ARGV; +my $pmg_list = Promulger::List->resolve($pmg_list_name); +die "no such list: $pmg_list_name\n" unless $pmg_list; + +run3 ['list_members', $mm_list_name], undef, \&add_member, undef; + +sub add_member { + my ($member) = @_; + chomp $member; + $pmg_list->subscribe($member); +}