diff options
author | Joey Hess <joey@kitenet.net> | 2011-09-09 11:17:27 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-09-09 11:17:27 -0400 |
commit | e845fcc47b244db30a8d19eaaf927de1d8c0a073 (patch) | |
tree | 81a08c988ca293f7ab097fe631ff9c5b88935cc6 /Debian/Debhelper/Dh_Buildsystems.pm | |
parent | f3afdd51e82972541cefebb15ec5a1d78ce67215 (diff) |
Tighten parsing of DEB_BUILD_OPTIONS.
A future nostripexceptonfullmoon option seems unlikely, but sure,
let's be strict. More importantly, let's reuse good code.
Diffstat (limited to 'Debian/Debhelper/Dh_Buildsystems.pm')
-rw-r--r-- | Debian/Debhelper/Dh_Buildsystems.pm | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/Debian/Debhelper/Dh_Buildsystems.pm b/Debian/Debhelper/Dh_Buildsystems.pm index 405b79c6..0a51a4d2 100644 --- a/Debian/Debhelper/Dh_Buildsystems.pm +++ b/Debian/Debhelper/Dh_Buildsystems.pm @@ -167,19 +167,12 @@ sub buildsystems_init { sub set_parallel { my $max=shift; - $opt_parallel=1; - - if (exists $ENV{DEB_BUILD_OPTIONS}) { - # 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+)$/) { - $opt_parallel = $1; - if ($max > 0 && $opt_parallel > $max) { - $opt_parallel = $max; - } - } - } + # Get number of processes from parallel=n option, limiting it + # with $max if needed + $opt_parallel=get_buildoption("parallel") || 1; + + if ($max > 0 && $opt_parallel > $max) { + $opt_parallel = $max; } } |