diff options
author | Modestas Vainius <modestas@vainius.eu> | 2009-12-04 00:11:00 +0200 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-12-04 15:02:01 -0500 |
commit | 3a6520173bbb2eb4c4212d3ce180b846423d5535 (patch) | |
tree | 75cfa8af5f69d3183c38fdc61d7a6559ec35b912 /Debian | |
parent | a933d27281d9fc7296f1028e7cf96c787b78ad7e (diff) | |
download | debhelper-3a6520173bbb2eb4c4212d3ce180b846423d5535.tar.gz |
In my opinion, this way of putting it is more obvious.
$max is about upper limit. Make algorithm reflect that.
(cherry picked from commit 62d7dc07b97a12912cfe08483c6fb244161224f5)
Diffstat (limited to 'Debian')
-rw-r--r-- | Debian/Debhelper/Dh_Buildsystems.pm | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Debian/Debhelper/Dh_Buildsystems.pm b/Debian/Debhelper/Dh_Buildsystems.pm index 77d7f945..d50c5173 100644 --- a/Debian/Debhelper/Dh_Buildsystems.pm +++ b/Debian/Debhelper/Dh_Buildsystems.pm @@ -165,14 +165,12 @@ sub set_parallel { $opt_parallel=1; if (exists $ENV{DEB_BUILD_OPTIONS}) { - # Parse parallel=n tag + # Get number of processes from parallel=n tag limiting it + # with $max if needed foreach my $opt (split(/\s+/, $ENV{DEB_BUILD_OPTIONS})) { - if ($opt =~ /^parallel=([-\d]+)$/) { - my $n=$1; - if ($n > 0 && ($max == -1 || $n < $max)) { - $opt_parallel = $n; - } - else { + if ($opt =~ /^parallel=(-?\d+)$/) { + $opt_parallel = $1; + if ($max > 0 && $opt_parallel > $max) { $opt_parallel = $max; } } |