diff options
author | Niels Thykier <niels@thykier.net> | 2017-06-04 18:58:42 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2017-06-13 20:25:02 +0000 |
commit | 9165ecdcacc70aee5d7b53ca607ad93de2ae7122 (patch) | |
tree | c516605165fea8d03807ad16e8989d561902d724 /doc | |
parent | 79da6af50c03f4a2508b1a6c0336d86470e7dd58 (diff) | |
download | debhelper-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/PROGRAMMING | 18 |
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: --------------- |