From bfb3de41aae23bb65afc62c228570b4a9578abcc Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 31 Jan 2024 10:20:16 +0000 Subject: lei convert: explicitly allow --sort for inputs LeiToMail can't sort v2 output, but sorting MH input (and NNTP spool + mlmmj archives) numerically makes sense. --- lib/PublicInbox/LeiConvert.pm | 1 + lib/PublicInbox/LeiToMail.pm | 2 ++ 2 files changed, 3 insertions(+) (limited to 'lib/PublicInbox') diff --git a/lib/PublicInbox/LeiConvert.pm b/lib/PublicInbox/LeiConvert.pm index 17a952f2..4d4fceb2 100644 --- a/lib/PublicInbox/LeiConvert.pm +++ b/lib/PublicInbox/LeiConvert.pm @@ -52,6 +52,7 @@ sub lei_convert { # the main "lei convert" method my ($lei, @inputs) = @_; $lei->{opt}->{kw} //= 1; $lei->{opt}->{dedupe} //= 'none'; + $lei->{input_opt}->{sort} = 1; # for LeiToMail conflict check my $self = bless {}, __PACKAGE__; my $ovv = PublicInbox::LeiOverview->new($lei, 'out-format'); $lei->{l2m} or return diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm index 9197bb44..a816df6c 100644 --- a/lib/PublicInbox/LeiToMail.pm +++ b/lib/PublicInbox/LeiToMail.pm @@ -451,6 +451,8 @@ EOM (-d $dst || (-e _ && !-w _)) and die "$dst exists and is not a writable file\n"; } + $lei->{input_opt} and # lei_convert sets this + @conflict = grep { !$lei->{input_opt}->{$_} } @conflict; my @err = map { defined($lei->{opt}->{$_}) ? "--$_" : () } @conflict; die "@err incompatible with $fmt\n" if @err; $self->{dst} = $dst; -- cgit v1.2.3-24-ge0c7