X-Git-Url: https://ruderich.org/simon/gitweb/?p=blhc%2Fblhc.git;a=blobdiff_plain;f=bin%2Fblhc;h=5e8e0181356613dca5de8afe591ce3ab24a5d684;hp=e3b83d9853910168a05dcb7ac9870f9244200c39;hb=f0ae7b1580cd26bcf44dc5b780f1c2e081314479;hpb=3eca6f2738379a5e68b1d134232184bc41ac05eb 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.