From: Simon Ruderich Date: Wed, 11 Apr 2012 23:09:44 +0000 (+0200) Subject: Also use buildd's "Architecture" header to detect architecture. X-Git-Tag: 0.01~4 X-Git-Url: https://ruderich.org/simon/gitweb/?p=blhc%2Fblhc.git;a=commitdiff_plain;h=f0ae7b1580cd26bcf44dc5b780f1c2e081314479 Also use buildd's "Architecture" header to detect architecture. --- diff --git a/bin/blhc b/bin/blhc index e3b83d9..5e8e018 100755 --- a/bin/blhc +++ b/bin/blhc @@ -535,6 +535,15 @@ foreach my $file (@ARGV) { my $harden_pie = $option_pie; # defaults to 0 while (my $line = <$fh>) { + # Detect architecture automatically unless overridden. For buildd logs + # only, doesn't use the dpkg-buildpackage header. Necessary to ignore + # build logs which aren't built (wrong architecture, build error, + # etc.). + if (not $arch + and $line =~ /^Architecture: (.+)$/) { + $arch = $1; + } + # dpkg-buildflags only provides hardening flags since 1.16.1, don't # check for hardening flags in buildd mode if an older dpkg-dev is # used. Default flags (-g -O2) are still checked. diff --git a/t/logs/buildd-dpkg-dev b/t/logs/buildd-dpkg-dev index 4cc32a5..b90eb85 100644 --- a/t/logs/buildd-dpkg-dev +++ b/t/logs/buildd-dpkg-dev @@ -1,3 +1,4 @@ +Architecture: i386 Toolchain package versions: ... dpkg-dev_1.16.1.2 ... dpkg-buildpackage: source package test diff --git a/t/tests.t b/t/tests.t index 1f83fa0..cfe2f9d 100644 --- a/t/tests.t +++ b/t/tests.t @@ -19,7 +19,7 @@ use strict; use warnings; -use Test::More tests => 134; +use Test::More tests => 136; sub is_blhc { @@ -648,6 +648,9 @@ is_blhc ['arch-avr32', 'arch-i386', 'empty', 'arch-mipsel'], . "ignoring architecture 'mipsel'\n" ; +is_blhc 'buildd-dpkg-dev', '--ignore-arch i386', 0, + "ignoring architecture 'i386'\n"; + # debian