]> ruderich.org/simon Gitweb - blhc/blhc.git/blobdiff - bin/blhc
Also use buildd's "Architecture" header to detect architecture.
[blhc/blhc.git] / bin / blhc
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>) {
+        # 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.