]> ruderich.org/simon Gitweb - blhc/blhc.git/blobdiff - bin/blhc
Fix false positive in C++ compiler detection
[blhc/blhc.git] / bin / blhc
index 9b785b1722a034af38ab27e14dd1cf143ccbb9d8..f90fd7a2e0422971cd2a7558d80b243fc18dd97e 100755 (executable)
--- a/bin/blhc
+++ b/bin/blhc
@@ -24,7 +24,7 @@ use warnings;
 use Getopt::Long ();
 use Text::ParseWords ();
 
-our $VERSION = '0.13';
+our $VERSION = '0.14';
 
 
 # CONSTANTS/VARIABLES
@@ -566,11 +566,12 @@ sub is_non_verbose_build {
     # C++ compiler setting.
     return 0 if $line =~ /^\s*C\+\+.+?:\s+(?:yes|no)\s*$/;
     return 0 if $line =~ /^\s*C\+\+ Library: stdc\+\+$/;
+    return 0 if $line =~ /^\s*CXX\s*:\s*g\+\+\s*$/;
     # "Compiling" non binary files.
     return 0 if $line =~ /^\s*Compiling \S+\.(?:py|pyx|el)['"]?\s*(?:\.\.\.|because it changed\.)?$/;
     return 0 if $line =~ /^\s*[Cc]ompiling catalog \S+\.po\b/;
     # cargo build
-    return 0 if $cargo and $line =~ m{^\s*Compiling\s+\S+\s+v\S+(?:\s+\(/<<PKGBUILDDIR>>\))?$};
+    return 0 if $cargo and $line =~ m{^\s*Compiling\s+\S+\s+v\S+(?:\s+\(/(?:<<PKGBUILDDIR>>|builds/\S+)\))?$};
     # "Compiling" with no file name.
     if ($line =~ /^\s*[Cc]ompiling\s+(.+?)(?:\.\.\.)?$/) {
         # $file_extension_regex may need spaces around the filename.
@@ -1179,11 +1180,13 @@ foreach my $file (@ARGV) {
     }
 
     if (scalar @input == 0) {
-        if (not $option_buildd) {
-            print "No compiler commands!\n";
-            $exit |= $exit_code{no_compiler_commands};
-        } else {
-            print "$buildd_tag{no_compiler_commands}||\n";
+        if (not $cargo) {
+            if (not $option_buildd) {
+                print "No compiler commands!\n";
+                $exit |= $exit_code{no_compiler_commands};
+            } else {
+                print "$buildd_tag{no_compiler_commands}||\n";
+            }
         }
         next FILE;
     }