[debhelper-devel] [debhelper] 01/07: dh_builddeb: Add dbgsym packages as separate tasks
Niels Thykier
nthykier at moszumanska.debian.org
Mon Jun 26 17:27:47 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 5086ca49a07599848492a277d8cbf505892749c0
Author: Niels Thykier <niels at thykier.net>
Date: Mon Jun 26 16:42:00 2017 +0000
dh_builddeb: Add dbgsym packages as separate tasks
Signed-off-by: Niels Thykier <niels at thykier.net>
---
debian/changelog | 2 ++
dh_builddeb | 56 ++++++++++++++++++++++++++++++++++----------------------
2 files changed, 36 insertions(+), 22 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 329e4f9..e4e0c37 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,6 +31,8 @@ debhelper (10.5.1) UNRELEASED; urgency=medium
* dh_install: Optimize some patterns into bulked "cp" calls. This
optimization is only applicable in some cases (notably, it is always
disabled by --exclude).
+ * dh_builddeb: Account for dbgsym packages separately when determining
+ how many tasks can be run in parallel.
-- Niels Thykier <niels at thykier.net> Sun, 25 Jun 2017 18:02:30 +0000
diff --git a/dh_builddeb b/dh_builddeb
index 668bdf2..2f346df 100755
--- a/dh_builddeb
+++ b/dh_builddeb
@@ -104,11 +104,40 @@ sub build_and_rename_deb {
"${destdir}/${desired_filename}");
}
-on_pkgs_in_parallel {
- foreach my $package (@_) {
- # child
- my $tmp=tmpdir($package);
+my @items;
+
+for my $package (@{$dh{DOPACKAGES}}) {
+ push(@items, [$package, 0]);
+ if (not is_udeb($package)) {
my $dbgsym_tmpdir = "debian/.debhelper/${package}/dbgsym-root";
+ my $dbgsym_control = "${dbgsym_tmpdir}/DEBIAN/control";
+ if ( -f $dbgsym_control) {
+ # Only build the dbgsym package if it has a control file.
+ # People might have skipped dh_gencontrol.
+ push(@items, [$package, 1]);
+ } elsif (-d $dbgsym_tmpdir) {
+ warning("Not building dbgsym package for ${package} as it has no control file");
+ warning("Please use dh_gencontrol to avoid this issue");
+ }
+ }
+}
+
+on_items_in_parallel(\@items, sub {
+ foreach my $item (@_) {
+ my ($package, $dbgsym) = @{$item};
+ my $tmp=tmpdir($package);
+
+ if ($dbgsym) {
+ my $dbgsym_tmpdir = "debian/.debhelper/${package}/dbgsym-root";
+ # XXX: Should we blindly overrule the maintainer here? It
+ # is not apparent that their explicit -z was intended for
+ # the dbgsym package.
+ my @args = default_compressor_args(["-z1", "-Zxz", "-Sextreme"],
+ @{$dh{U_PARAMS}});
+ doit("dpkg-deb", @args,
+ "--build", $dbgsym_tmpdir, $dh{DESTDIR});
+ next;
+ }
if (exists $ENV{DH_ALWAYS_EXCLUDE} && length $ENV{DH_ALWAYS_EXCLUDE}) {
if (! compat(5)) {
complex_doit("find $tmp $dh{EXCLUDE_FIND} | xargs rm -rf");
@@ -120,23 +149,6 @@ on_pkgs_in_parallel {
foreach split(":", $ENV{DH_ALWAYS_EXCLUDE});
}
}
- if ( -d $dbgsym_tmpdir) {
- my $dbgsym_control = "${dbgsym_tmpdir}/DEBIAN/control";
- # Only build the dbgsym package if it has a control file.
- # People might have skipped dh_gencontrol.
- if ( -f $dbgsym_control ) {
- # XXX: Should we blindly overrule the maintainer here? It
- # is not apparent that their explicit -z was intended for
- # the dbgsym package.
- my @args = default_compressor_args(["-z1", "-Zxz", "-Sextreme"],
- @{$dh{U_PARAMS}});
- doit("dpkg-deb", @args,
- "--build", $dbgsym_tmpdir, $dh{DESTDIR});
- } elsif (not is_udeb($package)) {
- warning("Not building dbgsym package 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});
}
@@ -161,7 +173,7 @@ on_pkgs_in_parallel {
}
}
}
-};
+});
=head1 SEE ALSO
--
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