diff options
author | Niels Thykier <niels@thykier.net> | 2015-05-20 08:51:51 +0200 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2015-05-20 08:51:51 +0200 |
commit | e8c0c44d703b501483b3f2cbfefcb71d490d7608 (patch) | |
tree | 57497efaad1785e729784c2698d9fce04efd6ab7 /dh_builddeb | |
parent | c0fa835256e35f0ba029693eb645dd10b8186494 (diff) |
dh_builddeb: Skip ddebs without control files
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'dh_builddeb')
-rwxr-xr-x | dh_builddeb | 24 |
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}); |