summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Debian/Debhelper/Dh_Lib.pm9
-rwxr-xr-xdh_installman2
-rw-r--r--doc/PROGRAMMING14
3 files changed, 17 insertions, 8 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index e84222bd..b64309d6 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -54,7 +54,7 @@ use vars qw(@EXPORT %dh);
&open_gz &reset_perm_and_owner &deprecated_functionality
&log_installed_files &buildarch &rename_path
&on_pkgs_in_parallel &on_selected_pkgs_in_parallel
- &rm_files &make_symlink_raw_target
+ &rm_files &make_symlink_raw_target &on_items_in_parallel
);
# The Makefile changes this if debhelper is installed in a PREFIX.
@@ -1669,10 +1669,10 @@ sub log_installed_files {
sub on_pkgs_in_parallel(&) {
unshift(@_, $dh{DOPACKAGES});
- goto \&on_selected_pkgs_in_parallel;
+ goto \&on_items_in_parallel;
}
-sub on_selected_pkgs_in_parallel {
+sub on_items_in_parallel {
my ($pkgs_ref, $code) = @_;
my @pkgs = @{$pkgs_ref};
my %pids;
@@ -1726,6 +1726,9 @@ sub on_selected_pkgs_in_parallel {
return;
}
+*on_selected_pkgs_in_parallel = \&on_items_in_parallel;
+
+
1
# Local Variables:
diff --git a/dh_installman b/dh_installman
index 899bd5a3..236774fe 100755
--- a/dh_installman
+++ b/dh_installman
@@ -123,7 +123,7 @@ init(options => {
my (@sofiles, @sodests);
my @all_packages = getpackages();
-on_selected_pkgs_in_parallel(\@all_packages, sub {
+on_items_in_parallel(\@all_packages, sub {
foreach my $package (@_) {
next if is_udeb($package);
diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING
index 43f68c61..47f86aa6 100644
--- a/doc/PROGRAMMING
+++ b/doc/PROGRAMMING
@@ -358,9 +358,9 @@ log_installed_files($package, @paths)
If a directory is listed, it and all paths recursively beneath is
also considered installed.
on_pkgs_in_parallel($code) - prototype: (&)
- Short hand for on_selected_pkgs_in_parallel with $dh{DOPACKAGES} as
+ Short hand for on_items_in_parallel with $dh{DOPACKAGES} as
as list of packages.
-on_selected_pkgs_in_parallel($pkg_list_ref, $code)
+on_items_in_parallel($pkg_list_ref, $code)
Splits all the packages in $pkg_list_ref into a number of groups
based on the max parallel (as decided by DEB_BUILD_OPTIONS)
A subprocess is forked for each group (minimum 1 process will be
@@ -369,13 +369,19 @@ on_selected_pkgs_in_parallel($pkg_list_ref, $code)
then process it and return normally on success.
Example:
my @all_packages = getpackages();
- on_selected_pkgs_in_parallel(\@all_packages, sub {
+ on_items_in_parallel(\@all_packages, sub {
for my $package (@_) {
my $tmp=tmpdir($package);
my $pkgfile = pkgfile($package, 'foo');
...;
}
- });
+ });
+ my @work_list = compute_work_list();
+ on_items_in_parallel(\@work_list, sub {
+ for my $item (@_) {
+ ...;
+ }
+ });
If there is an error, which should stop the build, please invoke
either "error()" or "error_exitcode". Alternatively, a trappable