line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package RPM::Packager::Utils; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
35722
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
51
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
56
|
|
5
|
2
|
|
|
2
|
|
10
|
use File::Find; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
110
|
|
6
|
2
|
|
|
2
|
|
18
|
use File::Spec; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
41
|
|
7
|
2
|
|
|
2
|
|
9
|
use File::Basename; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
599
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub is_command { |
10
|
5
|
|
|
5
|
0
|
657
|
my $val = shift; |
11
|
5
|
100
|
|
|
|
114
|
( $val !~ /^\d/ ) ? 1 : 0; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub eval_command { |
15
|
4
|
|
|
4
|
0
|
1464
|
my $cmd = shift; |
16
|
4
|
|
|
|
|
28353
|
chomp( my $val = `$cmd` ); |
17
|
4
|
|
|
|
|
296
|
return $val; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub find_files { |
21
|
3
|
|
|
3
|
0
|
3161
|
my $dir = shift; |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
11
|
my @files; |
24
|
3
|
|
|
9
|
|
26
|
my $coderef = sub { push @files, $File::Find::name; }; |
|
9
|
|
|
|
|
556
|
|
25
|
3
|
|
|
|
|
723
|
find( { wanted => $coderef, follow => 1, follow_skip => 2 }, $dir ); |
26
|
3
|
|
|
|
|
30
|
return @files; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub find_relative_paths { |
30
|
2
|
|
|
2
|
0
|
18
|
my ( $base, @files ) = @_; |
31
|
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
4
|
my @result; |
33
|
2
|
|
|
|
|
15
|
for my $file (@files) { |
34
|
6
|
|
|
|
|
753
|
my $rel_path = File::Spec->abs2rel( $file, $base ); |
35
|
6
|
|
|
|
|
229
|
push @result, { rel_path => $rel_path, dirname => dirname($rel_path) }; |
36
|
|
|
|
|
|
|
} |
37
|
2
|
|
|
|
|
14
|
return @result; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |