summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Dh_Buildsystems.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-10-29 16:12:57 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-10-29 16:12:57 -0400
commit7e35f3cf73dd5c6e4c8848217e33e2c6c8e00ed4 (patch)
tree5163d7a1610416ca018201e0003e420b382c8b17 /Debian/Debhelper/Dh_Buildsystems.pm
parent3c3ebf1ba6a7e93f7fb66d375ca8c1106d99af2c (diff)
implement the other option: parallel enabled implicitly by DEB_BUILD_OPTIONS
I renamed --parallel to --max-parallel to clarify that it doesn't enable parallelism, but only controls how much of it is allowed.
Diffstat (limited to 'Debian/Debhelper/Dh_Buildsystems.pm')
-rw-r--r--Debian/Debhelper/Dh_Buildsystems.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/Debian/Debhelper/Dh_Buildsystems.pm b/Debian/Debhelper/Dh_Buildsystems.pm
index b0e0a56..8713aab 100644
--- a/Debian/Debhelper/Dh_Buildsystems.pm
+++ b/Debian/Debhelper/Dh_Buildsystems.pm
@@ -112,6 +112,8 @@ sub load_all_buildsystems {
sub buildsystems_init {
my %args=@_;
+
+ my $max_parallel=0;
# Available command line options
my %options = (
@@ -127,28 +129,28 @@ sub buildsystems_init {
"l" => \$opt_list,
"list" => \$opt_list,
- "j:i" => \&set_parallel,
- "parallel:i" => \&set_parallel,
+ "max-parallel:i" => \$max_parallel,
);
$args{options}{$_} = $options{$_} foreach keys(%options);
Debian::Debhelper::Dh_Lib::init(%args);
+ set_parallel($max_parallel);
}
sub set_parallel {
- my ($option, $value)=@_;
+ my $max=shift;
- if ($value >= 0 && exists $ENV{DEB_BUILD_OPTIONS}) {
+ if (exists $ENV{DEB_BUILD_OPTIONS}) {
# Parse parallel=n tag
my $n;
foreach my $opt (split(/\s+/, $ENV{DEB_BUILD_OPTIONS})) {
$n = $1 if $opt =~ /^parallel=(\d+)$/;
}
if (defined $n && $n > 0) {
- if ($value == 0 || $n < $value) {
+ if ($max && $n < $max) {
$opt_parallel = $n;
}
else {
- $opt_parallel = $value;
+ $opt_parallel = $max;
}
}
else {