|
@@ -1,5 +1,5 @@
|
|
|
#! /usr/bin/perl -w
|
|
|
-# $Id: autoupdate.pl,v 1.24 2009/09/10 19:21:13 markus Exp $
|
|
|
+# $Id: autoupdate.pl,v 1.25 2009/09/20 08:21:58 markus Exp $
|
|
|
# Copyright (c) 2007,2008,2009
|
|
|
# Markus Hennecke <markus-hennecke@markus-hennecke.de>
|
|
|
#
|
|
@@ -65,6 +65,9 @@ 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 = ();
|
|
|
+
|
|
|
# Global abort flag, only set from the reaper func
|
|
|
my $abort = 0;
|
|
|
|
|
@@ -157,16 +160,17 @@ sub read_rc_file {
|
|
|
|
|
|
|
|
|
# Fill the pseudo flavors hash.
|
|
|
-sub setup_pseudo_flavors {
|
|
|
- my $config = shift;
|
|
|
+sub setup_lookup_hash {
|
|
|
+ my $config_line = shift;
|
|
|
+ my $hash = shift;
|
|
|
+ my $info = shift;
|
|
|
|
|
|
- if (defined $config->{pseudo_flavors}) {
|
|
|
- my $pseudos = $config->{pseudo_flavors};
|
|
|
- $pseudos =~ tr/,/ /;
|
|
|
- foreach (split / /, $pseudos) {
|
|
|
- print STDOUT "Adding pseudo flavor $_\n"
|
|
|
+ if (defined $config_line) {
|
|
|
+ $config_line =~ tr/,/ /;
|
|
|
+ foreach (split / /, $config_line) {
|
|
|
+ print STDOUT "Adding $_ to $info\n"
|
|
|
unless ($verbose < 2);
|
|
|
- $pseudo_flavors{$_} = 1;
|
|
|
+ $hash->{$_} = 1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -394,6 +398,15 @@ 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 {
|
|
@@ -507,6 +520,8 @@ sub build_pkg {
|
|
|
|
|
|
# Create the command that will build the package
|
|
|
my $cmd = 'env ';
|
|
|
+ $cmd .= "LIBTOOL=\"$portsdir/infrastructure/build/libtool\" "
|
|
|
+ if (needs_intree_libtool($info));
|
|
|
$cmd .= "FLAVOR=\"$info->{flavor}\" " if ($info->{flavor} ne '');
|
|
|
$cmd .= "SUBPACKAGE=$info->{subpkg} " if ($info->{subpkg} ne '');
|
|
|
$cmd .= 'make repackage';
|
|
@@ -694,12 +709,16 @@ usage() if ($show_help != 0 || ! $result || $num_jobs < 1);
|
|
|
|
|
|
# Fill the hash with the allowed variables
|
|
|
my %valid_vars = ( 'logging', 1,
|
|
|
+ 'libtool_ports', 1,
|
|
|
'pseudo_flavors', 1 );
|
|
|
|
|
|
# Read the config and set everything up
|
|
|
my $config = read_rc_file(\%valid_vars);
|
|
|
setup_logging($config);
|
|
|
-setup_pseudo_flavors($config);
|
|
|
+setup_lookup_hash($config->{pseudo_flavors}, \%pseudo_flavors,
|
|
|
+ 'pseudo flavors');
|
|
|
+setup_lookup_hash($config->{libtool_ports}, \%libtool_ports,
|
|
|
+ 'libtool ports');
|
|
|
|
|
|
print STDOUT "Reading package list scheduled for update...\n";
|
|
|
my $package_list = read_update_package_list($out_of_date);
|