# dgit repos policy hook script for Debian
use strict;
-$SIG{__WARN__} = sub { die $_[0]; };
+
+use Debian::Dgit qw(:DEFAULT :policyflags);
+setup_sigwarn();
use POSIX;
use JSON;
use IPC::Open2;
use Data::Dumper;
-use Debian::Dgit qw(:DEFAULT :policyflags);
use Debian::Dgit::Policy::Debian;
initdebug('%');
# [1] looking for the relevant git tag for the version number and not
# caring what that tag refers to.
#
+# When we are doing a push to a fresh repo, any version will do: in
+# this case, this is the first dgit upload of an existing package,
+# and we trust that the uploader hasn't included in their git
+# history any previous non-dgit uploads.
+#
# A wrinkle: if we approved a push recently, we treat NEW as having
# a version which is in our history. This is because the package may
# still be being uploaded. (We record this using the timestamp of the
}
if (length $freshrepo) {
- if (!good_suite_has_suitable_vsn(\&vsn_in_our_history)) {
+ if (!good_suite_has_suitable_vsn(sub { 1; })) {
stat $freshrepo or die "$freshrepo $!";
my $oldmode = ((stat _)[2]);
my $oldwrites = $oldmode & 0222;