Skip to content

Commit 14286b2

Browse files
Peter Oberparleiteroberpar
authored andcommitted
geninfo: make gcov tool version detection more robust
Don't consider gcov tool version information in parenthesis when determining the gcov tool version. This fixes problems where the version string contains a different version number in parenthesis before the actual gcov version. Signed-off-by: Peter Oberparleiter <[email protected]>
1 parent 0bde873 commit 14286b2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/geninfo

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if( $^O eq "msys" )
6161
}
6262

6363
# Constants
64-
our $lcov_version = 'LCOV version 1.11 pre (CVS $Revision: 1.124 $)';
64+
our $lcov_version = 'LCOV version 1.11 pre (CVS $Revision: 1.125 $)';
6565
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
6666
our $gcov_tool = "gcov";
6767
our $tool_name = basename($0);
@@ -1899,6 +1899,11 @@ sub get_gcov_version()
18991899
$version_string = <GCOV_PIPE>;
19001900
close(GCOV_PIPE);
19011901

1902+
# Remove version information in parenthesis to cope with the following:
1903+
# - gcov (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
1904+
# - gcov (crosstool-NG 1.18.0) 4.7.2
1905+
$version_string =~ s/\([^\)]*\)//g;
1906+
19021907
$result = 0;
19031908
if ($version_string =~ /(\d+)\.(\d+)(\.(\d+))?/)
19041909
{

0 commit comments

Comments
 (0)