]> ruderich.org/simon Gitweb - blhc/blhc.git/commitdiff
Fix detection of build dependencies for buildd logs.
authorSimon Ruderich <simon@ruderich.org>
Wed, 14 Aug 2013 14:40:44 +0000 (16:40 +0200)
committerSimon Ruderich <simon@ruderich.org>
Wed, 14 Aug 2013 14:40:44 +0000 (16:40 +0200)
Fixes Debian bug #719656, reported by Nicolas Boulenguez. Thanks.

MANIFEST
NEWS
bin/blhc
t/logs/ada
t/logs/debian
t/logs/debian-hardening-wrapper
t/logs/debian-hardening-wrapper-old-build-depends [new file with mode: 0644]
t/tests.t

index 0c403dbd49037df3826f101ab71e221773a1328f..d7fa680e156d827ecf21a02beff6989a2879d9c7 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -33,6 +33,7 @@ t/logs/debian-cmake
 t/logs/debian-cmake-2
 t/logs/debian-cmake-ok
 t/logs/debian-hardening-wrapper
+t/logs/debian-hardening-wrapper-old-build-depends
 t/logs/debian-hardening-wrapper-pbuilder
 t/logs/dpkg-buildpackage-architecture-old
 t/logs/empty
diff --git a/NEWS b/NEWS
index a4f5503c8038936040ce9ebfb46e1a0dc9cc31da..d113ec772c163ad2161e45449a66e0f1df05b7d4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ Version 0.XX
   #710135), reported by Bastien Roucariès.
 - Handle another case of Qt's `moc` (Debian bug #710780), reported by Felix
   Geyer.
+- Fix detection of build dependencies for buildd logs (Debian bug #719656),
+  reported by Nicolas Boulenguez.
 
 - Sync architecture specific hardening support with dpkg 1.17.1.
 
index 3ee85373e188ec7e52e18cce100b5294ebe77d5c..38d0834cd4c1ddc37b70602cf0d186f64fc769ae 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -729,9 +729,11 @@ foreach my $file (@ARGV) {
             }
         }
 
-        # Debian's build daemons use Build-Depends: for the build
-        # dependencies, but pbuilder just uses Depends:; support both.
-        if (index($line, 'Build-Depends: ') == 0
+        # Debian's build daemons use "Filtered Build-Depends:" (or just
+        # "Build-Depends:" in older versions) for the build dependencies, but
+        # pbuilder uses "Depends:"; support both.
+        if (index($line, 'Filtered Build-Depends: ') == 0
+                or 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,
index bc801c25c0af71c2050d82e5a620be7f3acc6fb1..fceb8b1bba8dde167442c407561a8dada19d6294 100644 (file)
@@ -1,4 +1,4 @@
-Build-Depends: ..., gnat, gnat-4.6, ...
+Filtered Build-Depends: ..., gnat, gnat-4.6, ...
 
 dpkg-buildpackage: source package ada package
 
index e93b1c51054ad4393605d19a0ddac1d1cd132451..bbb65cffc0fb14829a1b699f266ae46096d55cdc 100644 (file)
@@ -1,4 +1,4 @@
-Build-Depends: .., gcc (>= 4:4.4.3), g++ (>= 4:4.4.3), ...
+Filtered Build-Depends: .., gcc (>= 4:4.4.3), g++ (>= 4:4.4.3), ...
 Toolchain package versions: ...
 Package versions: ...
 
index 2e2966cef1e68bf51b1fa8e16664f899234ae68e..fbb06f78610bb879a61c7a2e5733a4018da61c2b 100644 (file)
@@ -1,4 +1,4 @@
-Build-Depends: .., hardening-wrapper, ...
+Filtered Build-Depends: .., hardening-wrapper, ...
 
 dpkg-buildpackage: source package test
 
diff --git a/t/logs/debian-hardening-wrapper-old-build-depends b/t/logs/debian-hardening-wrapper-old-build-depends
new file mode 100644 (file)
index 0000000..d460171
--- /dev/null
@@ -0,0 +1,9 @@
+# Old buildd versions used Build-Depends instead of Filtered Build-Depends.
+Build-Depends: .., hardening-wrapper, ...
+
+dpkg-buildpackage: source package test
+
+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 03302242367685cbf58387c3dbc3604c705b93ed..ad7a2620880075c1f2cbd02893387b33366f93f5 100644 (file)
--- a/t/tests.t
+++ b/t/tests.t
@@ -19,7 +19,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 206;
+use Test::More tests => 208;
 
 
 sub is_blhc {
@@ -884,6 +884,8 @@ my $debian_hardening_wrapper =
 ';
 is_blhc 'debian-hardening-wrapper', '', 16,
         $debian_hardening_wrapper;
+is_blhc 'debian-hardening-wrapper-old-build-depends', '', 16,
+        $debian_hardening_wrapper;
 is_blhc 'debian-hardening-wrapper-pbuilder', '', 16,
         $debian_hardening_wrapper;