X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FSearchIdx.pm;h=95b14c3a55de4c7adfa6bf58d700a98534850324;hb=14fa0abdcc7b6513540e529375e53edd74ce13e8;hp=6e2e614c5085c7e45fa33ad06375a9137af1ee31;hpb=7ffa98cbbf5bff8225fdfedb0f2b7c2beb5d0a6f;p=public-inbox.git
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 6e2e614c..95b14c3a 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2021 all contributors
+# Copyright (C) all contributors
# License: AGPL-3.0+
# based on notmuch, but with no concept of folders, files
#
@@ -20,7 +20,7 @@ use Carp qw(croak carp);
use POSIX qw(strftime);
use Time::Local qw(timegm);
use PublicInbox::OverIdx;
-use PublicInbox::Spawn qw(spawn nodatacow_dir);
+use PublicInbox::Spawn qw(spawn);
use PublicInbox::Git qw(git_unquote);
use PublicInbox::MsgTime qw(msg_timestamp msg_datestamp);
use PublicInbox::Address;
@@ -139,7 +139,8 @@ sub idx_acquire {
if (!-d $dir && (!$is_shard ||
($is_shard && need_xapian($self)))) {
File::Path::mkpath($dir);
- nodatacow_dir($dir);
+ require PublicInbox::Syscall;
+ PublicInbox::Syscall::nodatacow_dir($dir);
$self->{-set_has_threadid_once} = 1;
}
}
@@ -896,20 +897,20 @@ sub log2stack ($$$) {
push @cmd, "--$k=$v";
}
my $fh = $git->popen(@cmd, $range);
- my ($at, $ct, $stk, $cmt);
- while (<$fh>) {
+ my ($at, $ct, $stk, $cmt, $l);
+ while (defined($l = <$fh>)) {
return if $sync->{quit};
- if (/\A([0-9]+)-([0-9]+)-($OID)$/o) {
+ if ($l =~ /\A([0-9]+)-([0-9]+)-($OID)$/o) {
($at, $ct, $cmt) = ($1 + 0, $2 + 0, $3);
$stk //= PublicInbox::IdxStack->new($cmt);
- } elsif (/$del/) {
+ } elsif ($l =~ /$del/) {
my $oid = $1;
if ($D) { # reindex case
$D->{pack('H*', $oid)}++;
} else { # non-reindex case:
$stk->push_rec('d', $at, $ct, $oid, $cmt);
}
- } elsif (/$add/) {
+ } elsif ($l =~ /$add/) {
my $oid = $1;
if ($D) {
my $oid_bin = pack('H*', $oid);