about summary refs log tree commit homepage
path: root/script/public-inbox-index
diff options
context:
space:
mode:
Diffstat (limited to 'script/public-inbox-index')
-rwxr-xr-xscript/public-inbox-index14
1 files changed, 6 insertions, 8 deletions
diff --git a/script/public-inbox-index b/script/public-inbox-index
index e487e3fe..73ad9bc4 100755
--- a/script/public-inbox-index
+++ b/script/public-inbox-index
@@ -73,16 +73,14 @@ if (@ARGV) {
 sub usage { print STDERR "Usage: $usage\n"; exit 1 }
 usage() unless @dirs;
 
-foreach my $k (keys %$config) {
-        $k =~ /\Apublicinbox\.([^\.]+)\.mainrepo\z/ or next;
-        my $name = $1;
-        my $v = $config->{$k};
+$config->each_inbox(sub {
+        my ($ibx) = @_;
+
         for my $i (0..$#dirs) {
-                next if $dirs[$i] ne $v;
-                my $ibx = $config->lookup_name($name);
-                $dirs[$i] = $ibx if $ibx;
+                next if $dirs[$i] ne $ibx->{mainrepo};
+                $dirs[$i] = $ibx;
         }
-}
+});
 
 foreach my $dir (@dirs) {
         if (!ref($dir) && -f "$dir/inbox.lock") { # v2