chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Split brain: Print $unapplied tree hash to debug log, too
[dgit.git]
/
infra
/
dgit-repos-policy-debian
diff --git
a/infra/dgit-repos-policy-debian
b/infra/dgit-repos-policy-debian
index f20572d66314c3f999ef39f5a680c8f577eabeb8..4dab576f1a4257e3bff41aef8ac4f4b1d30105f1 100755
(executable)
--- a/
infra/dgit-repos-policy-debian
+++ b/
infra/dgit-repos-policy-debian
@@
-2,7
+2,9
@@
# dgit repos policy hook script for Debian
use strict;
# 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 POSIX;
use JSON;
@@
-11,7
+13,6
@@
use DBI;
use IPC::Open2;
use Data::Dumper;
use IPC::Open2;
use Data::Dumper;
-use Debian::Dgit qw(:DEFAULT :policyflags);
use Debian::Dgit::Policy::Debian;
initdebug('%');
use Debian::Dgit::Policy::Debian;
initdebug('%');
@@
-67,6
+68,11
@@
our %deliberately;
# [1] looking for the relevant git tag for the version number and not
# caring what that tag refers to.
#
# [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
# 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
@@
-346,19
+352,21
@@
END
my $mustreject=0;
while (my $taintid = shift @taintids) {
my $mustreject=0;
while (my $taintid = shift @taintids) {
- # git cat-file prints a spurious newline after it gets EOF
- # This is not documented. I guess it might go away. So we
- # just read what we expect and then let it get SIGPIPE.
$!=0; $_ = <CHKOUT>;
$!=0; $_ = <CHKOUT>;
- die "
$?
$!" unless defined $_;
+ die "
($taintid @objscatcmd)
$!" unless defined $_;
printdebug "|< ", $_ if $debuglevel>=2;
next if m/^\w+ missing$/;
printdebug "|< ", $_ if $debuglevel>=2;
next if m/^\w+ missing$/;
- die "$_ ?" unless m/^(\w+) (\w+) (\d+)\s/;
+ die "
($taintid @objscatcmd)
$_ ?" unless m/^(\w+) (\w+) (\d+)\s/;
my ($objid,$objtype,$nbytes) = ($1,$2,$3);
my $drop;
my ($objid,$objtype,$nbytes) = ($1,$2,$3);
my $drop;
- (read CHKOUT, $drop, $nbytes) == $nbytes or die;
+ (read CHKOUT, $drop, $nbytes) == $nbytes
+ or die "($taintid @objscatcmd) $!";
+
+ $!=0; $_ = <CHKOUT>;
+ die "($taintid @objscatcmd) $!" unless defined $_;
+ die "($taintid @objscatcmd) $_ ?" if m/\S/;
$taintinfoq ||= $poldbh->prepare(<<END);
SELECT package, time, comment FROM taints WHERE taint_id = ?
$taintinfoq ||= $poldbh->prepare(<<END);
SELECT package, time, comment FROM taints WHERE taint_id = ?
@@
-366,7
+374,7
@@
END
$taintinfoq->execute($taintid);
my $ti = $taintinfoq->fetchrow_hashref();
$taintinfoq->execute($taintid);
my $ti = $taintinfoq->fetchrow_hashref();
- die unless $ti;
+ die
"($taintid)"
unless $ti;
my $timeshow = defined $ti->{time}
? " at time ".strftime("%Y-%m-%d %H:%M:%S Z", gmtime $ti->{time})
my $timeshow = defined $ti->{time}
? " at time ".strftime("%Y-%m-%d %H:%M:%S Z", gmtime $ti->{time})
@@
-420,7
+428,7
@@
END
}
if (length $freshrepo) {
}
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;
stat $freshrepo or die "$freshrepo $!";
my $oldmode = ((stat _)[2]);
my $oldwrites = $oldmode & 0222;