]> ruderich.org/simon Gitweb - blhc/blhc.git/commitdiff
Also use buildd's "Architecture" header to detect architecture.
authorSimon Ruderich <simon@ruderich.org>
Wed, 11 Apr 2012 23:09:44 +0000 (01:09 +0200)
committerSimon Ruderich <simon@ruderich.org>
Wed, 11 Apr 2012 23:09:44 +0000 (01:09 +0200)
bin/blhc
t/logs/buildd-dpkg-dev
t/tests.t

index e3b83d9853910168a05dcb7ac9870f9244200c39..5e8e0181356613dca5de8afe591ce3ab24a5d684 100755 (executable)
--- 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>) {
     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.
         # 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.
index 4cc32a55d841acb35595c61bbf0fff4c429b07c5..b90eb853a8a0546bb470de786408631575ec229e 100644 (file)
@@ -1,3 +1,4 @@
+Architecture: i386
 Toolchain package versions: ... dpkg-dev_1.16.1.2 ...
 dpkg-buildpackage: source package test
 
 Toolchain package versions: ... dpkg-dev_1.16.1.2 ...
 dpkg-buildpackage: source package test
 
index 1f83fa05f408c0e796d9f8dab04eae8f08163cf8..cfe2f9dbb082724ddf068ca4f48f3b4564feaf81 100644 (file)
--- a/t/tests.t
+++ b/t/tests.t
@@ -19,7 +19,7 @@
 use strict;
 use warnings;
 
 use strict;
 use warnings;
 
-use Test::More tests => 134;
+use Test::More tests => 136;
 
 
 sub is_blhc {
 
 
 sub is_blhc {
@@ -648,6 +648,9 @@ is_blhc ['arch-avr32', 'arch-i386', 'empty', 'arch-mipsel'],
         . "ignoring architecture 'mipsel'\n"
         ;
 
         . "ignoring architecture 'mipsel'\n"
         ;
 
+is_blhc 'buildd-dpkg-dev', '--ignore-arch i386', 0,
+        "ignoring architecture 'i386'\n";
+
 
 # debian
 
 
 # debian