summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2017-06-04 18:58:42 +0000
committerNiels Thykier <niels@thykier.net>2017-06-13 20:25:02 +0000
commit9165ecdcacc70aee5d7b53ca607ad93de2ae7122 (patch)
treec516605165fea8d03807ad16e8989d561902d724 /doc
parent79da6af50c03f4a2508b1a6c0336d86470e7dd58 (diff)
downloaddebhelper-9165ecdcacc70aee5d7b53ca607ad93de2ae7122.tar.gz
Dh_Lib: Add on_pkgs_in_parallel
Signed-off-by: Niels Thykier <niels@thykier.net> fixup! Dh_Lib: Add on_each_pkg_in_parallel
Diffstat (limited to 'doc')
-rw-r--r--doc/PROGRAMMING18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING
index 02362809..1827811f 100644
--- a/doc/PROGRAMMING
+++ b/doc/PROGRAMMING
@@ -357,6 +357,24 @@ log_installed_files($package, @paths)
(e.g. avoid "foo/../bar" or "foo/./bar")
If a directory is listed, it and all paths recursively beneath is
also considered installed.
+on_pkgs_in_parallel($code) - prototype: (&)
+ Splits all the packages in $dh{DOPACKAGES} 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
+ forked) and each subprocess will be added a group of packages
+ to process. Each group is passed to the $code sub, which will
+ then process it and return normally on success.
+ Example:
+ on_pkgs_in_parallel {
+ for my $package (@_) {
+ my $tmp=tmpdir($package);
+ my $pkgfile = pkgfile($package, 'foo');
+ ...;
+ }
+ }
+
+ Keep in mind that the sub will always be run in a subprocess,
+ so it cannot update global state.
Sequence Addons:
---------------