|
@@ -63,6 +63,9 @@ my $portsdir_path = $ENV{PORTSDIR_PATH} || "$portsdir:$portsdir/mystuff";
|
|
|
# Number of jobs currently active
|
|
|
my $jobs = 0;
|
|
|
|
|
|
+# Number of concurrent jobs in a build
|
|
|
+my $make_jobs = 1;
|
|
|
+
|
|
|
# This hash will hold the PIDs of the forked build processes
|
|
|
my %forked_builds = ();
|
|
|
|
|
@@ -74,8 +77,8 @@ my $regex_subpkg = '(,-[a-z][a-z0-9_+-]*)?';
|
|
|
# List of pseudo flavors we apply if the port supports them
|
|
|
my %pseudo_flavors = ();
|
|
|
|
|
|
-# List of bad behaving ports that need libtool set to the in-tree libtool
|
|
|
-my %libtool_ports = ();
|
|
|
+# 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;
|
|
@@ -196,7 +199,7 @@ sub read_rc_file {
|
|
|
}
|
|
|
|
|
|
|
|
|
-# Fill the pseudo flavors hash.
|
|
|
+# Fill a lookup hash from config
|
|
|
sub setup_lookup_hash {
|
|
|
my $config_line = shift;
|
|
|
my $hash = shift;
|
|
@@ -400,13 +403,23 @@ 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,
|
|
|
subdir => $subdir,
|
|
|
subpkg => $subpackage,
|
|
|
flavor => $flavor,
|
|
|
- pkg => $pkg
|
|
|
+ pkg => $pkg,
|
|
|
+ jobs => $jobs,
|
|
|
);
|
|
|
$p{dependencies} = create_dependencies_list(\%p);
|
|
|
$p{deppkgs}
|
|
@@ -449,15 +462,6 @@ sub add_pseudo_flavors {
|
|
|
}
|
|
|
|
|
|
|
|
|
-# Returns true if the port is listed in the %libtool_ports hash
|
|
|
-sub needs_intree_libtool {
|
|
|
- my $info = shift;
|
|
|
-
|
|
|
- my $portdesc = $info->{category} . '/' . $info->{port};
|
|
|
- return (exists($libtool_ports{$portdesc}));
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
# Creates an array with pseudo flavors. We can check this array against the
|
|
|
# %pseudo_flavors hash to add flavors on demand.
|
|
|
sub create_pseudo_flavors_list {
|
|
@@ -572,8 +576,7 @@ sub build_pkg {
|
|
|
|
|
|
# Create the command that will build the package
|
|
|
my $cmd = 'env ';
|
|
|
- $cmd .= "LIBTOOL=\"$portsdir/infrastructure/bin/libtool\" "
|
|
|
- if (needs_intree_libtool($info));
|
|
|
+ $cmd .= 'MAKE_JOBS=' . $info->{jobs} . ' ';
|
|
|
$cmd .= "FLAVOR=\"$info->{flavor}\" " if ($info->{flavor} ne '');
|
|
|
$cmd .= "SUBPACKAGE=$info->{subpkg} " if ($info->{subpkg} ne '');
|
|
|
$cmd .= 'make repackage';
|
|
@@ -769,17 +772,19 @@ chdir($basedir);
|
|
|
|
|
|
# Fill the hash with the allowed variables
|
|
|
my %valid_vars = ( 'logging', 1,
|
|
|
- 'libtool_ports', 1,
|
|
|
+ 'make_jobs', 1,
|
|
|
+ 'nonconcurrent_builds', 1,
|
|
|
'sudo_make_clean', 1,
|
|
|
'pseudo_flavors', 1 );
|
|
|
|
|
|
# Read the config and set everything up
|
|
|
my $config = read_rc_file(\%valid_vars);
|
|
|
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->{libtool_ports}, \%libtool_ports,
|
|
|
- 'libtool ports');
|
|
|
+setup_lookup_hash($config->{nonconcurrent_builds}, \%nonconcurrent_builds,
|
|
|
+ 'nonconcurrent_builds');
|
|
|
$sudo_make_clean = $config->{sudo_make_clean}
|
|
|
if (defined $config->{sudo_make_clean});
|
|
|
|