Pārlūkot izejas kodu

dpkg-buildpackage: error out properly when dpkg-checkbuilddeps is killed

Use the standard function subprocerr() to error out when
dpkg-checkbuilddeps has not exited normally. Otherwise interpret the exit
code as usual.
Raphael Hertzog 17 gadi atpakaļ
vecāks
revīzija
9d1697bcc1
2 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  1. 2 0
      debian/changelog
  2. 5 1
      scripts/dpkg-buildpackage.pl

+ 2 - 0
debian/changelog

@@ -83,6 +83,8 @@ dpkg (1.15.1) UNRELEASED; urgency=low
     needed. Display a warning when it happens. Closes: #499088
   * Allow to combine -nc and -S in dpkg-buildpackage but display a warning
     saying that it's not advised. Closes: #304404
+  * Let dpkg-buildpackage error out with subprocerr() when dpkg-checkbuilddeps
+    is interrupted/killed by a signal. Closes: #498734
 
   [ Guillem Jover ]
   * Fix typo in dpkg output (‘unexecpted’ → ‘unexpected’). Closes: #519082

+ 5 - 1
scripts/dpkg-buildpackage.pl

@@ -5,6 +5,7 @@ use warnings;
 
 use Cwd;
 use File::Basename;
+use POSIX;
 
 use Dpkg;
 use Dpkg::Gettext;
@@ -344,7 +345,10 @@ if ($checkbuilddep) {
 	push @checkbuilddep_args, "--admindir=$admindir";
     }
 
-    if (system('dpkg-checkbuilddeps', @checkbuilddep_args)) {
+    system('dpkg-checkbuilddeps', @checkbuilddep_args);
+    if (not WIFEXITED($?)) {
+        subprocerr('dpkg-checkbuilddeps');
+    } elsif (WEXITSTATUS($?)) {
 	warning(_g("Build dependencies/conflicts unsatisfied; aborting."));
 	warning(_g("(Use -d flag to override.)"));