line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# vim: set ts=2 sts=2 sw=2 expandtab smarttab: |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# This file is part of Dist-Metadata |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# This software is copyright (c) 2011 by Randy Stauner. |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under |
8
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself. |
9
|
|
|
|
|
|
|
# |
10
|
4
|
|
|
4
|
|
2515
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
260
|
|
11
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
313
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
package Dist::Metadata::Tar; |
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
$Dist::Metadata::Tar::VERSION = '0.925'; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
BEGIN { |
18
|
4
|
|
|
4
|
|
83
|
$Dist::Metadata::Tar::AUTHORITY = 'cpan:RWSTAUNER'; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
# ABSTRACT: Enable Dist::Metadata for tar files |
21
|
|
|
|
|
|
|
|
22
|
4
|
|
|
4
|
|
5287
|
use Archive::Tar 1 (); # 0.07 isn't good enough |
|
4
|
|
|
|
|
542725
|
|
|
4
|
|
|
|
|
118
|
|
23
|
4
|
|
|
4
|
|
52
|
use Carp (); # core |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
76
|
|
24
|
4
|
|
|
4
|
|
983
|
use parent 'Dist::Metadata::Archive'; |
|
4
|
|
|
|
|
316
|
|
|
4
|
|
|
|
|
36
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
push(@Dist::Metadata::CARP_NOT, __PACKAGE__); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub file_content { |
29
|
23
|
|
|
23
|
1
|
76
|
my ( $self, $file ) = @_; |
30
|
23
|
|
|
|
|
156
|
return $self->archive->get_content( $self->full_path($file) ); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub find_files { |
34
|
11
|
|
|
11
|
1
|
20
|
my ($self) = @_; |
35
|
|
|
|
|
|
|
return |
36
|
35
|
|
|
|
|
1034
|
map { $_->full_path } |
|
35
|
|
|
|
|
542
|
|
37
|
11
|
|
|
|
|
113
|
grep { $_->is_file } |
38
|
|
|
|
|
|
|
$self->archive->get_files; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub read_archive { |
42
|
12
|
|
|
12
|
1
|
1009
|
my ($self, $file) = @_; |
43
|
|
|
|
|
|
|
|
44
|
12
|
|
|
|
|
114
|
my $archive = Archive::Tar->new(); |
45
|
12
|
|
|
|
|
221
|
$archive->read($file); |
46
|
|
|
|
|
|
|
|
47
|
12
|
|
|
|
|
84489
|
return $archive; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub tar { |
51
|
1
|
|
|
1
|
0
|
14
|
warn __PACKAGE__ . '::tar() is deprecated. Use archive() instead.'; |
52
|
1
|
|
|
|
|
16
|
return $_[0]->archive; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |