[projects/cleanbuild] findbr: check errors from mkmf.log as well

glen glen at pld-linux.org
Sat Oct 28 20:23:40 CEST 2017


commit d35930ef370c60180348aae3c601b6712ec32a44
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Sat Oct 28 21:23:14 2017 +0300

    findbr: check errors from mkmf.log as well

 findbr | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)
---
diff --git a/findbr b/findbr
index e1389ff..9e2c930 100755
--- a/findbr
+++ b/findbr
@@ -124,6 +124,7 @@ sub poldek_cmd
 
 my $check_ac = 0;
 my $check_config_log = undef;
+my $check_mkmf_log = undef;
 
 my %checked_files;
 sub poldek_file
@@ -515,6 +516,10 @@ while ( $_ = shift @lines ) {
 		$check_config_log = 1 unless defined $check_config_log;
 	}
 
+	if ( m{Check the mkmf.log file for more details} ) {
+		$check_mkmf_log = 1 unless defined $check_mkmf_log;
+	}
+
 	if ( m{^CMake (?:Error|Warning) at (?:\S+/)?(\S+?)\.cmake:(\d+) } ) {
 		my ( $module, $line ) = ( lc $1, $2 );
 		my $br;
@@ -684,7 +689,7 @@ while ( $_ = shift @lines ) {
 
 
 
-sub wanted
+sub find_configure
 {
 	return unless /^configure(\.(?:ac|in|in\.in))?$/;
 	return unless -r;
@@ -708,10 +713,10 @@ sub wanted
 
 use File::Find;
 if ( $check_ac ) {
-	find( \&wanted, $builddir );
+	find( \&find_configure, $builddir );
 }
 
-sub wanted2
+sub find_config_log
 {
 	return unless /^config\.log$/;
 	return unless -r;
@@ -724,7 +729,21 @@ sub wanted2
 
 if ( $check_config_log ) {
 	$check_config_log = 0;
-	find( \&wanted2, $builddir );
+	find( \&find_config_log, $builddir );
+	goto start_check if @lines;
+}
+
+if ($check_mkmf_log) {
+	$check_mkmf_log = 0;
+	find(sub {
+		return unless /^mkmf\.log$/;
+		return unless -r;
+
+		warn "$File::Find::name\n";
+		open F_IN, "<", $_;
+		push @lines, <F_IN>;
+		close F_IN;
+	}, $builddir);
 	goto start_check if @lines;
 }
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/cleanbuild.git/commitdiff/d35930ef370c60180348aae3c601b6712ec32a44



More information about the pld-cvs-commit mailing list