瀏覽代碼

dpkg-buildpackage: Detect missing sign-command before starting the build

While a failure in signing the resulting built artifacts is something
that can be easily recovered from, by just signing them again, it's
better if we just catch this beforehand.
Guillem Jover 12 年之前
父節點
當前提交
ff2114bd52
共有 2 個文件被更改,包括 8 次插入 和 3 次删除
  1. 2 0
      debian/changelog
  2. 6 3
      scripts/dpkg-buildpackage.pl

+ 2 - 0
debian/changelog

@@ -7,6 +7,8 @@ dpkg (1.17.6) UNRELEASED; urgency=low
     specify a package checker to use before the signing process.
   * Detect a missing gain-root-command even if dpkg-buildpackage is running
     as root.
+  * Detect a missing sign-command in dpkg-buildpackage, before starting the
+    build, to avoid a failure at the end of the process.
 
   [ Updated scripts translations ]
   * German (Helge Kreutzmann).

+ 6 - 3
scripts/dpkg-buildpackage.pl

@@ -313,9 +313,12 @@ if ($check_command and not find_command($check_command)) {
     error(_g("check-commmand '%s' not found"), $check_command);
 }
 
-if (!defined $signcommand &&
-    (($ENV{GNUPGHOME} && -e $ENV{GNUPGHOME}) ||
-     ($ENV{HOME} && -e "$ENV{HOME}/.gnupg"))) {
+if ($signcommand) {
+    if (!find_command($signcommand)) {
+        error(_g("sign-commmand '%s' not found"), $signcommand);
+    }
+} elsif (($ENV{GNUPGHOME} && -e $ENV{GNUPGHOME}) ||
+         ($ENV{HOME} && -e "$ENV{HOME}/.gnupg")) {
     if (find_command('gpg2')) {
         $signcommand = 'gpg2';
     } elsif (find_command('gpg')) {