X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bin%2Fdebbugs-rebuild-index.db;h=c44bc325cbfda479170b8c797b4daf546dad44e0;hb=5257767d84ebdc3c2c766bcecee6c046f5e78d5d;hp=49b925be63239f731ac4b636a6fc15492753cb0f;hpb=cebcfe4a025c588c5f9197b706a1b3c0ca61653e;p=debbugs.git diff --git a/bin/debbugs-rebuild-index.db b/bin/debbugs-rebuild-index.db index 49b925b..c44bc32 100755 --- a/bin/debbugs-rebuild-index.db +++ b/bin/debbugs-rebuild-index.db @@ -34,7 +34,7 @@ debbugs-rebuild-index.db [options] Debbugs spool directory; defaults to the value configured in the debbugs configuration file. -=item B<--debug, -d +=item B<--debug, -d> Debug verbosity. @@ -113,7 +113,11 @@ if (not lockpid($config{spool_dir}.'/lock/debbugs-rebuild-index.db')) { exit 1; } -my $file = "index.${initialdir}.realtime"; +my $fh_type = $initialdir; +# if initaldir is db-h, the file is db. +$fh_type = 'db' if $initialdir eq 'db-h'; + +my $file = "index.${fh_type}.realtime"; my $idx_rebuild = IO::File->new($file.'.rebuild','w') or die "Couldn't open ${file}.rebuild: $!"; @@ -145,7 +149,7 @@ while (my $dir = shift @dirs) { } } binmode($idx_rebuild,':raw:encoding(UTF-8)'); -print {$idx_rebuild} $bugs{$_} foreach sort keys %bugs; +print {$idx_rebuild} $bugs{$_} foreach sort {$a <=> $b} keys %bugs; close($idx_rebuild); rename("$file.rebuild", $file);