[debhelper-devel] [debhelper] 03/04: dh_installchangelogs: Run in parallel
Niels Thykier
nthykier at moszumanska.debian.org
Sun Jun 4 19:15:13 UTC 2017
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch parallel_dh_tools
in repository debhelper.
commit 6788dc92afc50d663b3366adf59056dd9a1e13c9
Author: Niels Thykier <niels at thykier.net>
Date: Sun Jun 4 19:01:11 2017 +0000
dh_installchangelogs: Run in parallel
---
dh_installchangelogs | 112 ++++++++++++++++++++++++++-------------------------
1 file changed, 57 insertions(+), 55 deletions(-)
diff --git a/dh_installchangelogs b/dh_installchangelogs
index 9dc2c96..f55df2c 100755
--- a/dh_installchangelogs
+++ b/dh_installchangelogs
@@ -166,74 +166,76 @@ elsif ($upstream=~m/\.html?$/i) {
$upstream_text=shift;
}
-foreach my $package (@{$dh{DOPACKAGES}}) {
- next if is_udeb($package);
+on_each_pkg_in_parallel {
+ foreach my $package (@_) {
+ next if is_udeb($package);
- my $tmp=tmpdir($package);
- my $changelog=pkgfile($package,"changelog");
- my $news=pkgfile($package,"NEWS");
+ my $tmp=tmpdir($package);
+ my $changelog=pkgfile($package,"changelog");
+ my $news=pkgfile($package,"NEWS");
- if (!$changelog) {
- $changelog="debian/changelog";
- }
- if (!$news) {
- $news="debian/NEWS";
- }
+ if (!$changelog) {
+ $changelog="debian/changelog";
+ }
+ if (!$news) {
+ $news="debian/NEWS";
+ }
- if (! -e $changelog) {
- error("could not find changelog $changelog");
- }
+ if (! -e $changelog) {
+ error("could not find changelog $changelog");
+ }
- # If it is a symlink to a documentation directory from the same
- # source package, then don't do anything. Think multi-binary
- # packages that depend on each other and want to link doc dirs.
- if (-l "$tmp/usr/share/doc/$package") {
- my $linkval=readlink("$tmp/usr/share/doc/$package");
- my %allpackages=map { $_ => 1 } getpackages();
- if ($allpackages{basename($linkval)}) {
- next;
+ # If it is a symlink to a documentation directory from the same
+ # source package, then don't do anything. Think multi-binary
+ # packages that depend on each other and want to link doc dirs.
+ if (-l "$tmp/usr/share/doc/$package") {
+ my $linkval=readlink("$tmp/usr/share/doc/$package");
+ my %allpackages=map { $_ => 1 } getpackages();
+ if ($allpackages{basename($linkval)}) {
+ next;
+ }
+ # Even if the target doesn't seem to be a doc dir from the
+ # same source package, don't do anything if it's a dangling
+ # symlink.
+ next unless -d "$tmp/usr/share/doc/$package";
}
- # Even if the target doesn't seem to be a doc dir from the
- # same source package, don't do anything if it's a dangling
- # symlink.
- next unless -d "$tmp/usr/share/doc/$package";
- }
- install_dir("$tmp/usr/share/doc/$package");
+ install_dir("$tmp/usr/share/doc/$package");
- if (! $dh{NO_ACT}) {
- if (! install_binNMU_changelog($package, $changelog, $changelog_name)) {
- install_file($changelog,
- "$tmp/usr/share/doc/$package/$changelog_name");
+ if (! $dh{NO_ACT}) {
+ if (! install_binNMU_changelog($package, $changelog, $changelog_name)) {
+ install_file($changelog,
+ "$tmp/usr/share/doc/$package/$changelog_name");
+ }
}
- }
-
- if (-e $news) {
- install_file($news, "$tmp/usr/share/doc/$package/$news_name");
- }
- if (defined $upstream) {
- my $link_to;
- my $base="$tmp/usr/share/doc/$package";
- if (defined $upstream_text) {
- install_file($upstream_text, "$base/changelog");
- $link_to='changelog';
+ if (-e $news) {
+ install_file($news, "$tmp/usr/share/doc/$package/$news_name");
}
- if (defined $upstream_html) {
- install_file($upstream_html,"$base/changelog.html");
- $link_to='changelog.html';
- if (! defined $upstream_text) {
- complex_doit("echo 'See changelog.html.gz' > $base/changelog");
- reset_perm_and_owner('0644',"$base/changelog");
+
+ if (defined $upstream) {
+ my $link_to;
+ my $base="$tmp/usr/share/doc/$package";
+ if (defined $upstream_text) {
+ install_file($upstream_text, "$base/changelog");
+ $link_to='changelog';
+ }
+ if (defined $upstream_html) {
+ install_file($upstream_html,"$base/changelog.html");
+ $link_to='changelog.html';
+ if (! defined $upstream_text) {
+ complex_doit("echo 'See changelog.html.gz' > $base/changelog");
+ reset_perm_and_owner('0644',"$base/changelog");
+ }
+ }
+ if ($dh{K_FLAG}) {
+ # Install symlink to original name of the upstream changelog file.
+ # Use basename in case original file was in a subdirectory or something.
+ doit("ln","-sf",$link_to,"$tmp/usr/share/doc/$package/".basename($upstream));
}
- }
- if ($dh{K_FLAG}) {
- # Install symlink to original name of the upstream changelog file.
- # Use basename in case original file was in a subdirectory or something.
- doit("ln","-sf",$link_to,"$tmp/usr/share/doc/$package/".basename($upstream));
}
}
-}
+};
=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