]> ruderich.org/simon Gitweb - blhc/blhc.git/commitdiff
Ignore unimportant lines at the end of the buildd log.
authorSimon Ruderich <simon@ruderich.org>
Thu, 22 Mar 2012 00:08:13 +0000 (01:08 +0100)
committerSimon Ruderich <simon@ruderich.org>
Thu, 22 Mar 2012 00:08:13 +0000 (01:08 +0100)
MANIFEST
bin/blhc
t/logs/buildd-package-details [new file with mode: 0644]
t/tests.t

index 7aaca6e8d511e890fdf2997b41d96d8de8d0e60c..6a79d894a1b78fb272ca96adc0593e89f2e063cd 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -16,6 +16,7 @@ t/logs/bad-library
 t/logs/bad-multiline
 t/logs/buildd-dpkg-dev
 t/logs/buildd-dpkg-dev-old
 t/logs/bad-multiline
 t/logs/buildd-dpkg-dev
 t/logs/buildd-dpkg-dev-old
+t/logs/buildd-package-details
 t/logs/c++
 t/logs/cc
 t/logs/configure
 t/logs/c++
 t/logs/cc
 t/logs/configure
index 3839ec90d296cbecc401e0677a393d81b62a61e8..e602106b5fd8f6d0140634cf517f21e67471a6f8 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -370,6 +370,10 @@ while (my $line = <>) {
     # false positives.
     $start = 1 if $line =~ /^dpkg-buildpackage:/;
     next if not $start;
     # false positives.
     $start = 1 if $line =~ /^dpkg-buildpackage:/;
     next if not $start;
+    # And stop at the end of the build log. Package details (reported by the
+    # buildd logs) are not important for us. This also prevents false
+    # positives.
+    last if $line =~ /^Build finished at \d{8}-\d{4}$/;
 
     # Detect architecture automatically unless overridden.
     if (not $option_arch
 
     # Detect architecture automatically unless overridden.
     if (not $option_arch
diff --git a/t/logs/buildd-package-details b/t/logs/buildd-package-details
new file mode 100644 (file)
index 0000000..0af7396
--- /dev/null
@@ -0,0 +1,16 @@
+Toolchain package versions: ... dpkg-dev_1.16.1.2 ...
+dpkg-buildpackage: source package test
+
+gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
+gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
+gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
+gcc -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.c
+gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
+
+Build finished at 20120308-1648
+# Everything after this is ignored.
+
+gcc -g -O2 -c test-a.c
+gcc -g -O2 -c test-b.c
+gcc -g -O2 -c test-c.c
+gcc -o test test-a.o test-b.o test-c.o -ltest
index 51bdf3a7dbda63e0429ca72e46585f650257fc14..ff9e3edb6f2aa9e1b267b2620d69248672c32378 100644 (file)
--- a/t/tests.t
+++ b/t/tests.t
@@ -19,7 +19,7 @@
 use strict;
 use warnings;
 
 use strict;
 use warnings;
 
-use Test::More tests => 84;
+use Test::More tests => 86;
 
 
 sub is_blhc {
 
 
 sub is_blhc {
@@ -543,6 +543,9 @@ LDFLAGS missing (-Wl,-z,relro): gcc -o test test.o `dpkg-buildflags --get CFLAGS
 
 # buildd support
 
 
 # buildd support
 
+is_blhc 'buildd-package-details', '--buildd', 0,
+        '';
+
 is_blhc 'buildd-dpkg-dev', '--buildd', 8,
         'CFLAGS missing (-fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc -g -O2 -c test-a.c
 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-a.c
 is_blhc 'buildd-dpkg-dev', '--buildd', 8,
         'CFLAGS missing (-fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc -g -O2 -c test-a.c
 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-a.c