In case some BOFH decides to randomly create directories
using non-ASCII digits all over the place.
my $mkey = $pfx.'max';
my $val = $self->{$mkey} or return;
my $lim;
my $mkey = $pfx.'max';
my $val = $self->{$mkey} or return;
my $lim;
- if ($val =~ /\A\d+\z/) {
+ if ($val =~ /\A[0-9]+\z/) {
require PublicInbox::Qspawn;
$lim = PublicInbox::Qspawn::Limiter->new($val);
} elsif ($val =~ /\A[a-z][a-z0-9]*\z/) {
require PublicInbox::Qspawn;
$lim = PublicInbox::Qspawn::Limiter->new($val);
} elsif ($val =~ /\A[a-z][a-z0-9]*\z/) {
if (opendir my $dh, $gits) {
my $max = -1;
while (defined(my $git_dir = readdir($dh))) {
if (opendir my $dh, $gits) {
my $max = -1;
while (defined(my $git_dir = readdir($dh))) {
- $git_dir =~ m!\A(\d+)\.git\z! or next;
+ $git_dir =~ m!\A([0-9]+)\.git\z! or next;
$max = $1 if $1 > $max;
}
$part = $self->{-max_git_part} = $max if $max >= 0;
$max = $1 if $1 > $max;
}
$part = $self->{-max_git_part} = $max if $max >= 0;
my $qpf = \($self->{qp_flags} ||= $QP_FLAGS);
if ($self->{version} >= 2) {
foreach my $part (<$dir/*>) {
my $qpf = \($self->{qp_flags} ||= $QP_FLAGS);
if ($self->{version} >= 2) {
foreach my $part (<$dir/*>) {
- -d $part && $part =~ m!/\d+\z! or next;
+ -d $part && $part =~ m!/[0-9]+\z! or next;
my $sub = Search::Xapian::Database->new($part);
if ($xdb) {
$xdb->add_database($sub);
my $sub = Search::Xapian::Database->new($part);
if ($xdb) {
$xdb->add_database($sub);
# due to -compact
if (-d $xpfx) {
foreach my $part (<$xpfx/*>) {
# due to -compact
if (-d $xpfx) {
foreach my $part (<$xpfx/*>) {
- -d $part && $part =~ m!/\d+\z! or next;
+ -d $part && $part =~ m!/[0-9]+\z! or next;
eval {
Search::Xapian::Database->new($part)->close;
$nparts++;
eval {
Search::Xapian::Database->new($part)->close;
$nparts++;
my $latest;
opendir my $dh, $pfx or die "opendir $pfx: $!\n";
while (defined(my $git_dir = readdir($dh))) {
my $latest;
opendir my $dh, $pfx or die "opendir $pfx: $!\n";
while (defined(my $git_dir = readdir($dh))) {
- $git_dir =~ m!\A(\d+)\.git\z! or next;
+ $git_dir =~ m!\A([0-9]+)\.git\z! or next;
if ($1 > $$max) {
$$max = $1;
$latest = "$pfx/$git_dir";
if ($1 > $$max) {
$$max = $1;
$latest = "$pfx/$git_dir";
} else {
opendir my $dh, $old or die "Failed to opendir $old: $!\n";
while (defined(my $dn = readdir($dh))) {
} else {
opendir my $dh, $old or die "Failed to opendir $old: $!\n";
while (defined(my $dn = readdir($dh))) {
- if ($dn =~ /\A\d+\z/) {
+ if ($dn =~ /\A[0-9]+\z/) {
my $tmpl = "$dn-XXXXXXXX";
my $dst = tempdir($tmpl, DIR => $old);
same_fs_or_die($old, $dst);
my $tmpl = "$dn-XXXXXXXX";
my $dst = tempdir($tmpl, DIR => $old);
same_fs_or_die($old, $dst);
my @p = split('/', $_[0]);
# return "xap15/0" for v2, or "xapian15" for v1:
my @p = split('/', $_[0]);
# return "xap15/0" for v2, or "xapian15" for v1:
- ($p[-1] =~ /\A\d+\z/) ? "$p[-2]/$p[-1]" : $p[-1];
+ ($p[-1] =~ /\A[0-9]+\z/) ? "$p[-2]/$p[-1]" : $p[-1];
}
# xapian-compact wrapper
}
# xapian-compact wrapper
$dst->set_metadata('last_commit', $lc) if $lc;
# only the first xapian partition (0) gets 'indexlevel'
$dst->set_metadata('last_commit', $lc) if $lc;
# only the first xapian partition (0) gets 'indexlevel'
- if ($old =~ m!(?:xapian\d+|xap\d+/0)\z!) {
+ if ($old =~ m!(?:xapian[0-9]+|xap[0-9]+/0)\z!) {
my $l = $src->get_metadata('indexlevel');
if ($l eq 'medium') {
$dst->set_metadata('indexlevel', $l);
my $l = $src->get_metadata('indexlevel');
if ($l eq 'medium') {
$dst->set_metadata('indexlevel', $l);
my $xdir_ro = $ibx->{search}->xdir(1);
my $npart = 0;
foreach my $part (<$xdir_ro/*>) {
my $xdir_ro = $ibx->{search}->xdir(1);
my $npart = 0;
foreach my $part (<$xdir_ro/*>) {
- if (-d $part && $part =~ m!/\d+\z!) {
+ if (-d $part && $part =~ m!/[0-9]+\z!) {
my $bytes = 0;
$bytes += -s $_ foreach glob("$part/*");
$npart++ if $bytes;
my $bytes = 0;
$bytes += -s $_ foreach glob("$part/*");
$npart++ if $bytes;