dump_rpm.pl untested

filter: Statementstmt 0.0% 0 / 21 Branchbran n/a Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 31 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/perl
2 use strict;
3 use RPM4;
4 use RPM4::Header;
5 use RPM::Header::PurePerl;
6  
7 my $rpmfile = shift or die("perl dump_rpm.pl rpmfile.rpm");
8 my $rpm4 = RPM4::Header->new($rpmfile);
9 foreach my $tag ($rpm4->listtag) {
10 print "$tag:".$rpm4->tagtype($tag).":".RPM4::tagName($tag);
11 print ":".$rpm4->tag($tag)."\n";
12 print "\n";
13 }
14  
15 tie my %rpmhdr, "RPM::Header::PurePerl", $rpmfile
16 or die "Problem, could not open $rpmfile";
17  
18 foreach my $tag (keys %rpmhdr) {
19 print "$tag:$rpmhdr{$tag}\n";
20 }