]> ruderich.org/simon Gitweb - blhc/blhc.git/commitdiff
Use index() in a few more places.
authorSimon Ruderich <simon@ruderich.org>
Sat, 7 Jul 2012 00:22:26 +0000 (02:22 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sat, 7 Jul 2012 00:22:26 +0000 (02:22 +0200)
bin/blhc

index 22ebd6f8a802e380e02d5a1fa02b0d92c45111a6..57ea0005df4f17712ef3e775d0e6ba8f1a829f12 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -641,8 +641,8 @@ foreach my $file (@ARGV) {
         # only, doesn't use the dpkg-buildpackage header. Necessary to ignore
         # build logs which aren't built (wrong architecture, build error,
         # etc.).
         # only, doesn't use the dpkg-buildpackage header. Necessary to ignore
         # build logs which aren't built (wrong architecture, build error,
         # etc.).
-        if (not $arch and $line =~ /^Architecture: (.+)$/) {
-            $arch = $1;
+        if (not $arch and index($line, 'Architecture: ') == 0) {
+            $arch = substr $line, 14, -1; # -1 to ignore '\n' at the end
         }
 
         # dpkg-buildflags only provides hardening flags since 1.16.1, don't
         }
 
         # dpkg-buildflags only provides hardening flags since 1.16.1, don't
@@ -713,12 +713,13 @@ foreach my $file (@ARGV) {
         # 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.
         # 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}$/;
+        last if index($line, 'Build finished at ') == 0
+                and $line =~ /^Build finished at \d{8}-\d{4}$/;
 
         # Detect architecture automatically unless overridden.
         if (not $arch
 
         # Detect architecture automatically unless overridden.
         if (not $arch
-                and $line =~ /^dpkg-buildpackage: host architecture (.+)$/) {
-            $arch = $1;
+                and index($line, 'dpkg-buildpackage: host architecture ') == 0) {
+            $arch = substr $line, 37, -1; # -1 to ignore '\n' at the end
         }
 
         # Ignore compiler warnings for now.
         }
 
         # Ignore compiler warnings for now.