X-Git-Url: https://ruderich.org/simon/gitweb/?p=blhc%2Fblhc.git;a=blobdiff_plain;f=bin%2Fblhc;h=01c0e0223499d5a436cd6ec181bab6a4c20546ed;hp=403775086fb88a849a5aae43791fa65bcff393e8;hb=e3d197b9a4f8aa60eaf053c7e3255fea2833e01c;hpb=6f81829798c6e302eb5ceea91ac4a41452754f98 diff --git a/bin/blhc b/bin/blhc index 4037750..01c0e02 100755 --- a/bin/blhc +++ b/bin/blhc @@ -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. @@ -842,12 +852,15 @@ foreach my $file (@ARGV) { [Cc]ompiler[\s.]*:?\s+ /x; next if $line =~ /^\s*(?:- )?(?:HOST_)?(?:CC|CXX)\s*=\s*$cc_regex_full\s*$/o; - # `moc-qt4`, contains '-I/usr/share/qt4/mkspecs/linux-g++' (or - # similar for other architectures) which gets recognized as a - # compiler line. Ignore it. - next if $line =~ m{^/usr/bin/moc-qt4 + # `moc-qt4`/`moc-qt5` contain '-I.../linux-g++' in their command + # line (or similar for other architectures) which gets recognized + # as a compiler line, but `moc-qt*` is only a preprocessor for Qt + # C++ files. No hardening flags are relevant during this step, + # thus ignore `moc-qt*` lines. The resulting files will be + # compiled in a separate step (and therefore checked). + next if $line =~ m{^\S+/bin/moc-qt[45] \s.+\s - -I/usr/share/qt4/mkspecs/[a-z]+-g\++(?:-64)? + -I\S+/mkspecs/[a-z]+-g\++(?:-64)? \s}x; # Ignore false positives when the line contains only CC=gcc but no # other gcc command.