|
@@ -77,9 +77,6 @@ my $regex_subpkg = '(,-[a-z][a-z0-9_+-]*)?';
|
|
|
# List of pseudo flavors we apply if the port supports them
|
|
|
my %pseudo_flavors = ();
|
|
|
|
|
|
-# List of ports that need MAKE_JOBS=1 to build successful
|
|
|
-my %nonconcurrent_builds = ();
|
|
|
-
|
|
|
# Global abort flag, only set from the reaper func
|
|
|
my $abort = 0;
|
|
|
|
|
@@ -388,7 +385,12 @@ sub create_package_information {
|
|
|
# identifier
|
|
|
# $6 : a list with optional flavors. Each flavor starts with
|
|
|
# a comma and may be an alphanumeric identifier
|
|
|
- if ($pkg =~ m/^([a-z][a-z0-9]*)\/([A-Za-z][\.A-Za-z0-9-+_]*)((\/[a-z0-9._-]*)*)?$regex_subpkg$regex_flavor/) {
|
|
|
+ if ($pkg =~ m/^
|
|
|
+ ([a-z][a-z0-9]*)\/
|
|
|
+ ([A-Za-z][\.A-Za-z0-9-+_]*)
|
|
|
+ ((\/[a-z0-9._-]*)*)?
|
|
|
+ $regex_subpkg
|
|
|
+ $regex_flavor/x) {
|
|
|
$category = $1;
|
|
|
$port = $2;
|
|
|
$subdir = $3;
|
|
@@ -403,15 +405,6 @@ sub create_package_information {
|
|
|
$flavor =~ s/,/ /g;
|
|
|
$flavor =~ s/^ //g;
|
|
|
|
|
|
- my $lookup_name = $category . '/' . $port;
|
|
|
- $lookup_name .= '/' . $subdir if $subdir;
|
|
|
- my $jobs = $make_jobs;
|
|
|
- $jobs = 1 if exists $nonconcurrent_builds{$lookup_name};
|
|
|
- print STDOUT 'Disabling concurrent builds for '
|
|
|
- .$lookup_name . "\n"
|
|
|
- if (exists $nonconcurrent_builds{$lookup_name}
|
|
|
- && ($make_jobs > 1));
|
|
|
-
|
|
|
my %p = (
|
|
|
category => $category,
|
|
|
port => $port,
|
|
@@ -419,9 +412,9 @@ sub create_package_information {
|
|
|
subpkg => $subpackage,
|
|
|
flavor => $flavor,
|
|
|
pkg => $pkg,
|
|
|
- jobs => $jobs,
|
|
|
);
|
|
|
$p{dependencies} = create_dependencies_list(\%p);
|
|
|
+ $p{jobs} = set_parallel_build(\%p);
|
|
|
$p{deppkgs}
|
|
|
= create_dependencies_hash($p{dependencies});
|
|
|
$p{pseudo_flavors} = create_pseudo_flavors_list(\%p);
|
|
@@ -647,6 +640,29 @@ sub build_pkg {
|
|
|
}
|
|
|
|
|
|
|
|
|
+sub set_parallel_build {
|
|
|
+ my $info = shift;
|
|
|
+
|
|
|
+ my $cur_dir = getcwd;
|
|
|
+ my $cmd = 'make show=PARALLEL_BUILD';
|
|
|
+ my ($port, $port_dir) = find_newer_ports_dir($info);
|
|
|
+ chdir $port_dir or die "Unable to change to '$port_dir'\n";
|
|
|
+
|
|
|
+ my $parallel = 1;
|
|
|
+ open(my $in, "$cmd |")
|
|
|
+ or die "Unable to determine parallel build info for \"$port\"\n";
|
|
|
+ while (<$in>) {
|
|
|
+ chomp;
|
|
|
+ $parallel &= ($_ eq 'Yes');
|
|
|
+ }
|
|
|
+ close($in);
|
|
|
+ chdir $cur_dir;
|
|
|
+
|
|
|
+ $info->{jobs} = ($parallel) ? $make_jobs : 1;
|
|
|
+ return $info->{jobs};
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
# Creates the dependencies list for a given port from the port information
|
|
|
# hash
|
|
|
sub create_dependencies_list {
|
|
@@ -666,7 +682,7 @@ sub create_dependencies_list {
|
|
|
chdir $port_dir or die "Unable to change to \"$port_dir\"\n";
|
|
|
|
|
|
open(my $in, "$cmd |")
|
|
|
- or die "Unable to get get dependencies for \"$port\"\n";
|
|
|
+ or die "Unable to get dependencies for \"$port\"\n";
|
|
|
while (<$in>) {
|
|
|
chomp;
|
|
|
push @dep_list, ($_);
|
|
@@ -773,7 +789,6 @@ chdir($basedir);
|
|
|
# Fill the hash with the allowed variables
|
|
|
my %valid_vars = ( 'logging', 1,
|
|
|
'make_jobs', 1,
|
|
|
- 'nonconcurrent_builds', 1,
|
|
|
'sudo_make_clean', 1,
|
|
|
'pseudo_flavors', 1 );
|
|
|
|
|
@@ -783,8 +798,6 @@ setup_logging($config);
|
|
|
$make_jobs = $config->{make_jobs} if $config->{make_jobs};
|
|
|
setup_lookup_hash($config->{pseudo_flavors}, \%pseudo_flavors,
|
|
|
'pseudo flavors');
|
|
|
-setup_lookup_hash($config->{nonconcurrent_builds}, \%nonconcurrent_builds,
|
|
|
- 'nonconcurrent_builds');
|
|
|
$sudo_make_clean = $config->{sudo_make_clean}
|
|
|
if (defined $config->{sudo_make_clean});
|
|
|
|