]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-convert
config: simplify lookup* methods
[public-inbox.git] / script / public-inbox-convert
index bd8fb9855b1eeee7617553c54845340afa2a458c..9d2d2512a403f99f2d994429d43f166796575e9e 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2018-2019 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <http://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
@@ -103,7 +103,7 @@ while (<$rd>) {
                $state = 'blob';
        } elsif (/^commit /) {
                $state = 'commit';
-       } elsif (/^data (\d+)/) {
+       } elsif (/^data ([0-9]+)/) {
                my $len = $1;
                $w->print($_) or $im->wfail;
                while ($len) {
@@ -114,7 +114,7 @@ while (<$rd>) {
                }
                next;
        } elsif ($state eq 'commit') {
-               if (m{^M 100644 :(\d+) (${h}{2}/${h}{38})}o) {
+               if (m{^M 100644 :([0-9]+) (${h}{2}/${h}{38})}o) {
                        my ($mark, $path) = ($1, $2);
                        $D{$path} = $mark;
                        if ($last && $last ne 'm') {
@@ -134,7 +134,7 @@ while (<$rd>) {
                        $last = 'd';
                        next;
                }
-               if (m{^from (:\d+)}) {
+               if (m{^from (:[0-9]+)}) {
                        $prev = $from;
                        $from = $1;
                        # no next