]> ruderich.org/simon Gitweb - blhc/blhc.git/blobdiff - bin/blhc
Detect architecture in old buildd logs which add an "is".
[blhc/blhc.git] / bin / blhc
index c13f3b6961b1a41ecfcf8ef91fd6c4433ba05e1e..f2f0d6f1253055d81c918f23ca64670c37826b51 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -250,11 +250,11 @@ my @flag_refs_all = (
 # Renaming rules for the output so the regex parts are not visible. Also
 # stores string values of flag regexps above, see compile_flag_regexp().
 my %flag_renames = (
-    '-O(?:2|3)'         => '-O2',
-    '-Wformat(?:=2)?'   => '-Wformat',
+    '-O(?:2|3)'                    => '-O2',
+    '-Wformat(?:=2)?'              => '-Wformat',
     '--param[= ]ssp-buffer-size=4' => '--param=ssp-buffer-size=4',
-    '-Wl,(?:-z,)?relro' => '-Wl,-z,relro',
-    '-Wl,(?:-z,)?now'   => '-Wl,-z,now',
+    '-Wl,(?:-z,)?relro'            => '-Wl,-z,relro',
+    '-Wl,(?:-z,)?now'              => '-Wl,-z,now',
 );
 
 my %exit_code = (
@@ -723,7 +723,10 @@ foreach my $file (@ARGV) {
             }
         }
 
-        if (index($line, 'Build-Depends: ') == 0) {
+        # Debian's build daemons use Build-Depends: for the build
+        # dependencies, but pbuilder just uses Depends:; support both.
+        if (index($line, 'Build-Depends: ') == 0
+                or index($line, 'Depends: ') == 0) {
             # If hardening wrapper is used (wraps calls to gcc and adds
             # hardening flags automatically) we can't perform any checks,
             # abort.
@@ -768,6 +771,13 @@ foreach my $file (@ARGV) {
         if (not $arch
                 and index($line, 'dpkg-buildpackage: host architecture ') == 0) {
             $arch = substr $line, 37, -1; # -1 to ignore '\n' at the end
+
+            # Old buildd logs use e.g. "host architecture is alpha", remove
+            # the "is", otherwise debarch_to_debtriplet() will not detect the
+            # architecture.
+            if (index($arch, 'is ') == 0) {
+                $arch = substr $arch, 3;
+            }
         }
 
         # Ignore compiler warnings for now.