chiark / gitweb /
dgit-repos-policy-debian: Better error handling
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 4 Jun 2016 18:45:12 +0000 (19:45 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jul 2016 15:47:46 +0000 (16:47 +0100)
Show more info when git-cat-file --batch goes wrong

debian/changelog
infra/dgit-repos-policy-debian

index e38f83dff11cd0ef4afb521fa8f02c6f9994c0bb..7543f58ea2235423458da2c1571e0e81791a882c 100644 (file)
@@ -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.
 
index 7ad2c7d57b48145d095e68d8d80fa2e314f42bff..d687a3e065501d3ffea00b238333ceb291e35133 100755 (executable)
@@ -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; $_ = <CHKOUT>;
-       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(<<END);
             SELECT package, time, comment FROM taints WHERE taint_id =  ?
@@ -372,7 +373,7 @@ END
         $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})