summaryrefslogtreecommitdiff
path: root/dh_builddeb
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2015-05-20 08:51:51 +0200
committerNiels Thykier <niels@thykier.net>2015-05-20 08:51:51 +0200
commite8c0c44d703b501483b3f2cbfefcb71d490d7608 (patch)
tree57497efaad1785e729784c2698d9fce04efd6ab7 /dh_builddeb
parentc0fa835256e35f0ba029693eb645dd10b8186494 (diff)
dh_builddeb: Skip ddebs without control files
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'dh_builddeb')
-rwxr-xr-xdh_builddeb24
1 files changed, 16 insertions, 8 deletions
diff --git a/dh_builddeb b/dh_builddeb
index c827f2f3..3eb0811f 100755
--- a/dh_builddeb
+++ b/dh_builddeb
@@ -117,14 +117,22 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}
}
if ( -d $ddeb_tmpdir) {
- my $ddeb_filename = '/' . ddeb_filename($package);
- # XXX: Should we blindly overrule the maintainer here? It is
- # not apparent that their explicit -z was intended for the
- # ddeb.
- my @args = default_compressor_args(["-z1", "-Zxz", "-Sextreme"],
- @{$dh{U_PARAMS}});
- doit("dpkg-deb", @args,
- "--build", $ddeb_tmpdir, $dh{DESTDIR}.$ddeb_filename);
+ my $ddeb_control = "${ddeb_tmpdir}/DEBIAN/control";
+ # Only build the ddeb if it has a control file. People might
+ # have skipped dh_gencontrol.
+ if ( -f $ddeb_control ) {
+ my $ddeb_filename = '/' . ddeb_filename($package);
+ # XXX: Should we blindly overrule the maintainer here? It
+ # is not apparent that their explicit -z was intended for
+ # the ddeb.
+ my @args = default_compressor_args(["-z1", "-Zxz", "-Sextreme"],
+ @{$dh{U_PARAMS}});
+ doit("dpkg-deb", @args,
+ "--build", $ddeb_tmpdir, $dh{DESTDIR}.$ddeb_filename);
+ } else {
+ warning("Not building ddeb for ${package} as it has no control file");
+ warning("Please use dh_gencontrol to avoid this issue");
+ }
}
if (! is_udeb($package)) {
doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME});