From b21cfdd3e2339dee97950dfd8a88ddb274b3f674 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Thu, 1 Mar 2018 10:45:32 +0100 Subject: [PATCH] Use proper look back for non-verbose detection for DEB_BUILD_OPTIONS=parallel --- MANIFEST | 1 + NEWS | 3 +++ bin/blhc | 2 +- t/logs/parallel | 11 +++++++++++ t/tests.t | 4 +++- 5 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 t/logs/parallel diff --git a/MANIFEST b/MANIFEST index 09932f4..590b416 100644 --- a/MANIFEST +++ b/MANIFEST @@ -61,6 +61,7 @@ t/logs/ignore-flag-ldflags t/logs/ignore-line t/logs/libtool t/logs/make +t/logs/parallel t/logs/qt4 t/logs/verbose-build t/tests.t diff --git a/NEWS b/NEWS index 798589e..79787a9 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,9 @@ Version 0.XX detect if the compiler applied PIE internally (c.f. Debian Bug 845339). - Add --line-numbers command line option - Sync architecture specific hardening support with dpkg 1.19.0.5. +- Use proper look back for non-verbose detection if DEB_BUILD_OPTIONS=parallel + is present. Previously it was too small causing false-positives if the + option was detected. Version 0.07 diff --git a/bin/blhc b/bin/blhc index b37bf6e..8297b7d 100755 --- a/bin/blhc +++ b/bin/blhc @@ -872,7 +872,7 @@ foreach my $file (@ARGV) { # This flags is not always available, but if it is use it. if ($line =~ /^DEB_BUILD_OPTIONS=.*\bparallel=(\d+)/) { - $parallel = $1; + $parallel = $1 * 2; } # We skip over unimportant lines at the beginning of the log to diff --git a/t/logs/parallel b/t/logs/parallel new file mode 100644 index 0000000..ad30895 --- /dev/null +++ b/t/logs/parallel @@ -0,0 +1,11 @@ +DEB_BUILD_OPTIONS=parallel=2 + +dpkg-buildpackage: source package test + +[ 3%] Building C object fec/CMakeFiles/fec.dir/encode_rs_char.c.o +[ 6%] Building C object fec/CMakeFiles/fec.dir/decode_rs_char.c.o +cd /<>/obj-x86_64-linux-gnux32/fec && /usr/bin/cc -g -O2 -fdebug-prefix-map=/<>=. -specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wno-unused -o CMakeFiles/fec.dir/decode_rs_char.c.o -c /<>/fec/decode_rs_char.c +cd /<>/obj-x86_64-linux-gnux32/fec && /usr/bin/cc -g -O2 -fdebug-prefix-map=/<>=. -specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wno-unused -o CMakeFiles/fec.dir/encode_rs_char.c.o -c /<>/fec/encode_rs_char.c +[ 9%] Building C object fec/CMakeFiles/fec.dir/init_rs_char.c.o +cd /<>/obj-x86_64-linux-gnux32/fec && /usr/bin/cc -g -O2 -fdebug-prefix-map=/<>=. -specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wno-unused -o CMakeFiles/fec.dir/init_rs_char.c.o -c /<>/fec/init_rs_char.c +[ 12%] Linking C static library libfec.a diff --git a/t/tests.t b/t/tests.t index 3aa79b1..4eabdcf 100644 --- a/t/tests.t +++ b/t/tests.t @@ -19,7 +19,7 @@ use strict; use warnings; -use Test::More tests => 232; +use Test::More tests => 234; sub is_blhc { @@ -635,6 +635,8 @@ NONVERBOSE BUILD: Compiling test.c \ gcc test.c NONVERBOSE BUILD: [ 3%] Building CXX object scribus/text/CMakeFiles/scribus_text_lib.dir/frect.cpp.o '; +is_blhc 'parallel', '', 0, ''; + # handle debug builds -- 2.43.2