X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FStatus.pm;h=73506611a26d585da976a31576b1b7a9008cda8c;hb=759994a97a3e747305961b38eecd825d910e0c59;hp=52b42a2dac866b53509110e6e92168fbad4ff880;hpb=337e79cfd28d94749e681048fb8b32441ba37ff5;p=debbugs.git diff --git a/Debbugs/Status.pm b/Debbugs/Status.pm index 52b42a2..7350661 100644 --- a/Debbugs/Status.pm +++ b/Debbugs/Status.pm @@ -276,7 +276,7 @@ sub read_bug{ my $status_modified = (stat($status))[9]; # Add log last modified time - $data{log_modified} = (stat($log))[9]; + $data{log_modified} = (stat($log))[9] // (stat("${log}.gz"))[9]; $data{last_modified} = max($status_modified,$data{log_modified}); $data{location} = $location; $data{archived} = (defined($location) and ($location eq 'archive'))?1:0; @@ -512,12 +512,14 @@ sub lock_read_all_merged_bugs { push @data,$newdata; # perform a sanity check to make sure that the merged bugs # are all merged with eachother - my $expectmerge= join(' ',grep {$_ != $bug } sort { $a <=> $b } @bugs); + # We do a cmp sort instead of an <=> sort here, because that's + # what merge does + my $expectmerge= join(' ',grep {$_ != $bug } sort @bugs); if ($newdata->{mergedwith} ne $expectmerge) { for (1..$locks) { unfilelock(exists $param{locks}?$param{locks}:()); } - die "Bug $param{bug} differs from bug $bug: ($newdata->{bug_num}: '$newdata->{mergedwith}') vs. ('$expectmerge') (".join(' ',@bugs).")"; + die "Bug $param{bug} mergedwith differs from bug $bug: ($newdata->{bug_num}: '$newdata->{mergedwith}') vs. ('$expectmerge') (".join(' ',@bugs).")"; } } } @@ -657,7 +659,7 @@ sub makestatus { Writes the bug status and summary files out. -Skips writting out a status file if minversion is 2 +Skips writing out a status file if minversion is 2 Does not call bughook if disablebughook is true. @@ -730,9 +732,9 @@ sub addfoundversions { my $version = shift; my $isbinary = shift; return unless defined $version; - undef $package if $package =~ m[(?:\s|/)]; + undef $package if defined $package and $package =~ m[(?:\s|/)]; my $source = $package; - if ($package =~ s/^src://) { + if (defined $package and $package =~ s/^src://) { $isbinary = 0; $source = $package; } @@ -775,7 +777,7 @@ exactly are removed. Otherwise, all versions matching the version number are removed. Currently $package and $isbinary are entirely ignored, but accepted -for backwards compatibilty. +for backwards compatibility. =cut