]> Sergey Matveev's repositories - public-inbox.git/commitdiff
scripts/import_vger_from_mbox: relax From_ line match slightly
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Thu, 8 Feb 2018 03:49:51 +0000 (03:49 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Thu, 8 Feb 2018 03:49:51 +0000 (03:49 +0000)
The mboxes I got from cregit have two spaces after the email
address, while the "git format-patch" output I'm used to dealing
with only has one space.

It's still a "strict" match in that it checks for something
resembling a timestamp, but it relaxes the number of spaces
between the email address and date.

scripts/import_vger_from_mbox

index 44055ffda5c38bc84c43e5df2bdb530814f25eca..9b3afc888b6fa38bec9e90992f8f0f790cbcf930 100644 (file)
@@ -28,7 +28,7 @@ sub do_add ($$) {
 }
 
 # asctime: From example@example.com Fri Jun 23 02:56:55 2000
-my $from_strict = qr/^From \S+ \S+ \S+ +\S+ [^:]+:[^:]+:[^:]+ [^:]+/;
+my $from_strict = qr/^From \S+ +\S+ \S+ +\S+ [^:]+:[^:]+:[^:]+ [^:]+/;
 my $prev = undef;
 while (defined(my $l = <STDIN>)) {
        if ($l =~ /$from_strict/o) {