diff options
Diffstat (limited to 'doc/PROGRAMMING')
-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: --------------- |