From: Ian Jackson Date: Sat, 4 Jun 2016 18:45:12 +0000 (+0100) Subject: dgit-repos-policy-debian: Better error handling X-Git-Tag: archive/debian/2.0~338 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=86daff8924bab3297885cfe375341bf3f4ffe09c;ds=sidebyside dgit-repos-policy-debian: Better error handling Show more info when git-cat-file --batch goes wrong --- diff --git a/debian/changelog b/debian/changelog index e38f83df..7543f58e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,9 @@ dgit (1.5~~) unstable; urgency=medium * dgit sbuild no longer deletes extranious .changes files; instead we rely on --rm-old-changes, or failing that, fail early. + Infrastructure: + * Better error handling in dgit-repos-policy-debian. + Documentation: * Document the dgit-distro.DISTRO.quilt-mode config setting. diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index 7ad2c7d5..d687a3e0 100755 --- a/infra/dgit-repos-policy-debian +++ b/infra/dgit-repos-policy-debian @@ -356,7 +356,7 @@ END # This is not documented. I guess it might go away. So we # just read what we expect and then let it get SIGPIPE. $!=0; $_ = ; - die "$? $!" unless defined $_; + die "($taintid @objscatcmd) $!" unless defined $_; printdebug "|< ", $_ if $debuglevel>=2; next if m/^\w+ missing$/; @@ -364,7 +364,8 @@ END 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) $!"; $taintinfoq ||= $poldbh->prepare(<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})