Skip to content
Permalink
Browse files
dgcov: also remove rpm dependency on IO::Uncompress::Gunzip
and enable option bundling
  • Loading branch information
vuvova committed Dec 3, 2022
1 parent 7baf24a commit 180b2bc
Showing 1 changed file with 5 additions and 5 deletions.
@@ -36,6 +36,7 @@
my %cov;
my $file_no=0;

Getopt::Long::Configure ("bundling");
GetOptions
("v|verbose+" => \$opt_verbose,
"h|help" => \$opt_help,
@@ -188,17 +189,16 @@ sub gcov_one_file {
close(FH);
}
} else {
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
require IO::Uncompress::Gunzip;
require JSON::PP;
my $gcov_file_json;
my $fname;
s/\.gcda$// if $gcc_version >= 11;
gunzip "$_.gcov.json.gz" => \$gcov_file_json or die "gunzip($_.gcov.json.gz): $GunzipError";
IO::Uncompress::Gunzip::gunzip("$_.gcov.json.gz", \$gcov_file_json)
or die "gunzip($_.gcov.json.gz): $IO::Uncompress::Gunzip::GunzipError";
my $obj= JSON::PP::decode_json $gcov_file_json;
for my $file (@{$obj->{files}}) {
$fname= $file->{file};
for my $line (@{$file->{lines}}){
$cov{$fname}->{$line->{line_number}}+= $line->{count};
$cov{$file->{file}}->{$line->{line_number}}+= $line->{count};
}
}
}

0 comments on commit 180b2bc

Please sign in to comment.