summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2013-12-16 06:29:05 +0100
committerGuillem Jover <guillem@debian.org>2013-12-17 05:28:43 +0100
commitff2114bd522d72488d82824ccc5c4d96997c062b (patch)
tree972e88f2b7d60629aaf7725f739d205aae171a59
parentbe3bb946cea90bc68fa480c580b33a99cb19906d (diff)
downloaddpkg-ff2114bd522d72488d82824ccc5c4d96997c062b.tar.gz
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.
-rw-r--r--debian/changelog2
-rwxr-xr-xscripts/dpkg-buildpackage.pl9
2 files changed, 8 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index fd5778b0c..d4c0431af 100644
--- a/debian/changelog
+++ b/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).
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 6e922b636..343989cf4 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/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')) {