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;
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).")";
}
}
}
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.
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;
}
number are removed.
Currently $package and $isbinary are entirely ignored, but accepted
-for backwards compatibilty.
+for backwards compatibility.
=cut