From 5257767d84ebdc3c2c766bcecee6c046f5e78d5d Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Thu, 21 Mar 2013 14:41:33 -0700 Subject: [PATCH] fix unterminated B<> sequence sort bugs by number in rebuild it's index.db.realtime, not index.db-h.realtime. --- bin/debbugs-rebuild-index.db | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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); -- 2.39.2