{ return join("\n", map join(': ', @$_), @{(shift)->{trace}})."\n" }
}
+{
+ package Local::Exception::signature_replay;
+ {our @ISA = qw(Local::Exception)}
+
+ sub summary { return 'directive signature timestamp older than expected' }
+
+ sub message { my $M = <<'END'; return join(' ', split /\n/, $M); }
+GPG signed upload older than/same timestamp as existing version - not
+allowed. In other words, the filenames for the triplet you have uploaded
+are an exact match for a triplet that has been uploaded in the past, and
+the directive file that you just uploaded has been signed before or at the
+same time as the directive file for the triplet that was uploaded earlier.
+Most likely, you are re-uploading an old triplet.
+END
+}
+
{
package Local::Exception::unknown_package;
{our @ISA = qw(Local::Exception)}
if (exists($serials{$full_filename})
&& ($serials{$full_filename} >= $new_epoch)) {
flock(SERIALS,4); # Release lock
- fatal("GPG signed upload older than/same timestamp as existing version "
- ."- not allowed. In other words, the filenames for the triplet "
- ."you have uploaded are an exact match for a triplet that has "
- ."been uploaded in the past, and the directive file that you "
- ."just uploaded has been signed before or at the same time as "
- ."the directive file for the triplet that was uploaded earlier. "
- ."Most likely, you are re-uploading an old triplet.",1);
+ throw signature_replay =>
+ previous_timestamp => $old_epoch, new_timestamp => $new_epoch
}
$serials{$full_filename} = $new_epoch;
mail(join("\n",$E->summary,'',$E->trace_msg),1);
} elsif ($E->type_p('package_configuration')) {
mail($E->summary,0);
- } elsif ($E->type_p('unknown_package')) {
+ } elsif ($E->type_p('signature_replay')
+ || $E->type_p('unknown_package')) {
mail($E->message,1);
}
} else {