Ver Fonte

Handle ports that require the in-tree libtool without having to patch the
ports Makefile.
Each port requireing the in-tree libtool should be added to the
libtool_ports variable in the rc file. The environment variable LIBTOOL is
set to the in-tree version when the port is beeing build.

Markus Hennecke há 14 anos atrás
pai
commit
2791979530
3 ficheiros alterados com 40 adições e 33 exclusões
  1. 7 15
      README
  2. 29 10
      autoupdate.pl
  3. 4 8
      autoupdaterc

+ 7 - 15
README

@@ -15,26 +15,18 @@ those ports I am currently aware of, but I guess that the list will grow
 in the future.
 in the future.
 
 
 Some ports can be build via using the systems own libtool, for these ports
 Some ports can be build via using the systems own libtool, for these ports
-patches for the Makefile are in the patches subdirectory. These may change
-in the future.
-
-There will be a more aggressive handling of those broken ports in the
-future, some advice was posted on the misc@ mailinglist which includes
-removing the file the port has previously installed before the build and
-moving them back after the build finished.
-
-2. Currently there is no handling of pseudo flavors. A prominent example
-would be qt3, you can omit installing and building the databases mysql,
-sqlite3 and postgresql using a pseudo flavor. There is currently no way
-for the script to check if one of those was used while originally building
-the port.
+patches for the Makefile are in the patches subdirectory. With the current
+version of the script, those ports may be added to the variable 
+"libtool_ports" in the rc file, if a port is listed there the LIBTOOL
+environment variable will be set while the script is running, no need to
+patch the Makefile of the port any more.
 
 
-3. It is not yet finished. There are major parts missing like command line
+2. It is not yet finished. There are major parts missing like command line
 handling and handling of some of the problems described above automatically.
 handling and handling of some of the problems described above automatically.
 I have installed a limited set of packages, so some corner cases may
 I have installed a limited set of packages, so some corner cases may
 require a different handling or an altered regex for parsing the output from
 require a different handling or an altered regex for parsing the output from
 the out-of-date script. Feel free to report those things to me.
 the out-of-date script. Feel free to report those things to me.
 
 
-4. Some ports are updated and get another dependency list. These dependencies
+3. Some ports are updated and get another dependency list. These dependencies
 may not be installed yet, so they are silently build by the updated port.
 may not be installed yet, so they are silently build by the updated port.
 
 

+ 29 - 10
autoupdate.pl

@@ -1,5 +1,5 @@
 #! /usr/bin/perl -w
 #! /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
 # Copyright (c) 2007,2008,2009
 #    Markus Hennecke <markus-hennecke@markus-hennecke.de>
 #    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
 # List of pseudo flavors we apply if the port supports them
 my %pseudo_flavors = ();
 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
 # Global abort flag, only set from the reaper func
 my $abort = 0;
 my $abort = 0;
 
 
@@ -157,16 +160,17 @@ sub read_rc_file {
 
 
 
 
 # Fill the pseudo flavors hash.
 # 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);
 			    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
 # Creates an array with pseudo flavors. We can check this array against the
 # %pseudo_flavors hash to add flavors on demand.
 # %pseudo_flavors hash to add flavors on demand.
 sub create_pseudo_flavors_list {
 sub create_pseudo_flavors_list {
@@ -507,6 +520,8 @@ sub build_pkg {
 
 
 	# Create the command that will build the package
 	# Create the command that will build the package
 	my $cmd = 'env ';
 	my $cmd = 'env ';
+	$cmd .= "LIBTOOL=\"$portsdir/infrastructure/build/libtool\" "
+	    if (needs_intree_libtool($info));
 	$cmd .= "FLAVOR=\"$info->{flavor}\" " if ($info->{flavor} ne '');
 	$cmd .= "FLAVOR=\"$info->{flavor}\" " if ($info->{flavor} ne '');
 	$cmd .= "SUBPACKAGE=$info->{subpkg} " if ($info->{subpkg} ne '');
 	$cmd .= "SUBPACKAGE=$info->{subpkg} " if ($info->{subpkg} ne '');
 	$cmd .= 'make repackage';
 	$cmd .= 'make repackage';
@@ -694,12 +709,16 @@ usage() if ($show_help != 0 || ! $result || $num_jobs < 1);
 
 
 # Fill the hash with the allowed variables
 # Fill the hash with the allowed variables
 my %valid_vars = ( 'logging', 1,
 my %valid_vars = ( 'logging', 1,
+		   'libtool_ports', 1,
 		   'pseudo_flavors', 1 );
 		   'pseudo_flavors', 1 );
 
 
 # Read the config and set everything up
 # Read the config and set everything up
 my $config = read_rc_file(\%valid_vars);
 my $config = read_rc_file(\%valid_vars);
 setup_logging($config);
 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";
 print STDOUT "Reading package list scheduled for update...\n";
 my $package_list = read_update_package_list($out_of_date);
 my $package_list = read_update_package_list($out_of_date);

+ 4 - 8
autoupdaterc

@@ -20,11 +20,7 @@ logging = 1
 
 
 # List of ports behaving bad when building while another version of the
 # List of ports behaving bad when building while another version of the
 # port is already installed.
 # port is already installed.
-# These will get a rather harsh treatment moving all files to a temporary
-# location and cleaning up after the new port was build. Procedure is:
-# 1. Move all files out of the way
-# 2. Build the port
-# 3. Move files back
-# 4. Update the port
-# Note that while building these port the system may not be fully useable.
-#bad_ports = devel/pango graphics/cairo x11/gtk+2 devel/glib2 audio/faad devel/libsoup
+libtool_ports = audio/faad databases/freedts devel/glib2 devel/pango \
+	devel/startup-notification graphics/cairo x11/dbus-glib x11/gtk+2 \
+	devel/libsoup multimedia/gstreamer-0.10 net/pidgin \
+	security/libgcrypt