Преглед на файлове

Get up to date with the changes made in 5.1 and current.

Markus Hennecke преди 12 години
родител
ревизия
d9f04ecda3
променени са 1 файла, в които са добавени 20 реда и са изтрити 5 реда
  1. 20 5
      autoupdate.pl

+ 20 - 5
autoupdate.pl

@@ -1,5 +1,5 @@
 #! /usr/bin/perl -w
-# $Id: autoupdate.pl,v 1.33 2010/12/30 13:31:39 markus Exp $
+# $Id: autoupdate.pl,v 1.34 2012/03/04 16:09:46 markus Exp $
 # Copyright (c) 2007,2008,2009
 #    Markus Hennecke <markus-hennecke@markus-hennecke.de>
 #
@@ -24,6 +24,7 @@ use OpenBSD::PackageName;
 use Getopt::Long;
 use FindBin;
 use File::Spec;
+use POSIX qw/uname/;
 
 # Silence the warning that is issued because List::Util won't register
 # $a and $b in a correct way for us
@@ -79,6 +80,9 @@ my %libtool_ports = ();
 # Global abort flag, only set from the reaper func
 my $abort = 0;
 
+# Ports that failed to build
+my @aborted = ();
+
 # This function will remove the finished forked build from the list of
 # currently build ports.
 sub REAPER {
@@ -93,6 +97,7 @@ sub REAPER {
 		}
 		else {
 			print STDOUT "Build aborted of ";
+			push @aborted, ($forked_builds{$wpid});
 		}
 		print $forked_builds{$wpid} . "\n";
 		delete $forked_builds{$wpid};
@@ -282,8 +287,16 @@ sub read_update_package_list {
 	}
 
 	if (not defined $input) {
+		my $ood_path = 'infrastructure/';
+		my @uname = POSIX::uname();
+		if ($uname[2] >= 5.1) {
+			$ood_path .= 'bin';
+		}
+		else {
+			$ood_path .= 'build';
+		}
 		my $cmd = "env PORTSDIR=\"$portsdir\" "
-		    . "\"$portsdir/infrastructure/build/out-of-date\" ";
+		    . "\"$portsdir/$ood_path/out-of-date\" ";
 		unless (open($in, $cmd . '2>/dev/null |')) {
 			print STDERR "Unable to execute $cmd\n";
 			exit 1;
@@ -527,12 +540,12 @@ sub build_pkg {
 		return;
 	}
 
-	# Give the parent time to update the forked_builds hash
-	sleep 1;
-
 	# The child must use the default sig handler for SIGCHLD
 	$SIG{CHLD} = 'DEFAULT';
 
+	# Give the parent time to update the forked_builds hash
+	sleep 1;
+
 	# Create the command that will build the package
 	my $cmd = 'env ';
 	$cmd .= "LIBTOOL=\"$portsdir/infrastructure/bin/libtool\" "
@@ -558,6 +571,8 @@ sub build_pkg {
 			. " for $info->{pkg}\n";
 	}
 	while (<$in>) {
+		exit 1 if (/^Detected loop/);
+
 		print STDOUT $_ unless (($verbose < 2) || ($num_jobs > 1));
 		print $logfile $_ if (defined $logfile);
 		push @log, ($_);