[debhelper-devel] [debhelper] 02/02: dh_builddeb: Add some missing error checks

Niels Thykier nthykier at moszumanska.debian.org
Thu Sep 21 19:16:11 UTC 2017


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit 2e078770ddf154bea792af1a6cdf72f9e1d12d2f
Author: Niels Thykier <niels at thykier.net>
Date:   Thu Sep 21 19:14:43 2017 +0000

    dh_builddeb: Add some missing error checks
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog | 6 ++++++
 dh_builddeb      | 7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index ea437d8..564fbe3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+debhelper (10.9.1) UNRELEASED; urgency=medium
+
+  * dh_builddeb: Add some missing error checks.
+
+ -- Niels Thykier <niels at thykier.net>  Thu, 21 Sep 2017 19:13:19 +0000
+
 debhelper (10.9) unstable; urgency=medium
 
   [ Niels Thykier ]
diff --git a/dh_builddeb b/dh_builddeb
index 1e37d5d..a412789 100755
--- a/dh_builddeb
+++ b/dh_builddeb
@@ -76,15 +76,18 @@ sub build_and_rename_deb {
 	my ($dpkg_filename, $desired_filename);
 	install_dir($build_dir);
 	doit(@${cmd}, $build_dir);
-	opendir(my $fd, $build_dir);
+	opendir(my $fd, $build_dir) or error("opendir($build_dir) failed: $!");
 	for my $name (readdir($fd)) {
 		next if $name eq '.' or $name eq '..';
 		if ($dpkg_filename) {
-			error("\"@{$cmd}\" produced two debs: $dpkg_filename and $name");
+			error("\"@{$cmd} ${build_dir}\" produced two debs: $dpkg_filename and $name");
 		}
 		$dpkg_filename = $name;
 	}
 	closedir($fd);
+	if (not defined($dpkg_filename)) {
+		error("\"@{$cmd} ${build_dir}\" did not produce *any* file but was successful!?");
+	}
 	local $_ = $dpkg_filename;
 	$rename_sub->();
 	$desired_filename = $_;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list