]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/InboxWritable.pm
wwwstream: show relative coderepo URLs correctly
[public-inbox.git] / lib / PublicInbox / InboxWritable.pm
index e97c7e2d7588b903a0917c803cc8f0cde4b81a91..c0e88f3d52ad1e21b6ec5a470ceff423af0fca5b 100644 (file)
@@ -102,7 +102,7 @@ sub filter {
                        $im->done;
                }
 
-               my @args = (-inbox => $self);
+               my @args = (ibx => $self);
                # basic line splitting, only
                # Perhaps we can have proper quote splitting one day...
                ($f, @args) = split(/\s+/, $f) if $f =~ /\s+/;
@@ -287,6 +287,8 @@ sub warn_ignore {
        # PublicInbox::MsgTime
        || $s =~ /^bogus TZ offset: .+?, ignoring and assuming \+0000/
        || $s =~ /^bad Date: .+? in /
+       # Encode::Unicode::UTF7
+       || $s =~ /^Bad UTF7 data escape at /
 }
 
 # this expects to be RHS in this assignment: "local $SIG{__WARN__} = ..."
@@ -298,25 +300,11 @@ sub warn_ignore_cb {
        }
 }
 
-# v2+ only
-sub git_dir_n { "$_[0]->{inboxdir}/git/$_[1].git" }
-
-# v2+ only
+# v2+ only, XXX: maybe we can just rely on ->max_git_epoch and remove
 sub git_dir_latest {
        my ($self, $max) = @_;
-       $$max = -1;
-       my $pfx = "$self->{inboxdir}/git";
-       return unless -d $pfx;
-       my $latest;
-       opendir my $dh, $pfx or die "opendir $pfx: $!\n";
-       while (defined(my $git_dir = readdir($dh))) {
-               $git_dir =~ m!\A([0-9]+)\.git\z! or next;
-               if ($1 > $$max) {
-                       $$max = $1;
-                       $latest = "$pfx/$git_dir";
-               }
-       }
-       $latest;
+       defined($$max = $self->max_git_epoch) ?
+               "$self->{inboxdir}/git/$$max.git" : undef;
 }
 
 1;