line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Archive::Tar::Constant; |
2
|
|
|
|
|
|
|
|
3
|
19
|
|
|
10
|
|
90899
|
use strict; |
|
9
|
|
|
|
|
27
|
|
|
19
|
|
|
|
|
942
|
|
4
|
9
|
|
|
10
|
|
60
|
use warnings; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
299
|
|
5
|
|
|
|
|
|
|
|
6
|
9
|
|
|
10
|
|
52
|
use vars qw[$VERSION @ISA @EXPORT]; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
1031
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
BEGIN { |
9
|
9
|
|
|
10
|
|
67
|
require Exporter; |
10
|
|
|
|
|
|
|
|
11
|
9
|
|
|
|
|
28
|
$VERSION = '3.02'; |
12
|
9
|
|
|
|
|
156
|
@ISA = qw[Exporter]; |
13
|
|
|
|
|
|
|
|
14
|
9
|
50
|
|
|
|
448
|
require Time::Local if $^O eq "MacOS"; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
@EXPORT = Archive::Tar::Constant->_list_consts( __PACKAGE__ ); |
18
|
|
|
|
|
|
|
|
19
|
9
|
|
|
10
|
|
78
|
use constant FILE => 0; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
551
|
|
20
|
9
|
|
|
10
|
|
57
|
use constant HARDLINK => 1; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
458
|
|
21
|
9
|
|
|
10
|
|
61
|
use constant SYMLINK => 2; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
424
|
|
22
|
9
|
|
|
10
|
|
55
|
use constant CHARDEV => 3; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
646
|
|
23
|
9
|
|
|
10
|
|
67
|
use constant BLOCKDEV => 4; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
459
|
|
24
|
9
|
|
|
10
|
|
48
|
use constant DIR => 5; |
|
9
|
|
|
|
|
34
|
|
|
9
|
|
|
|
|
414
|
|
25
|
9
|
|
|
10
|
|
61
|
use constant FIFO => 6; |
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
425
|
|
26
|
9
|
|
|
10
|
|
62
|
use constant SOCKET => 8; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
480
|
|
27
|
9
|
|
|
10
|
|
124
|
use constant UNKNOWN => 9; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
443
|
|
28
|
9
|
|
|
10
|
|
51
|
use constant LONGLINK => 'L'; |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
451
|
|
29
|
9
|
|
|
10
|
|
54
|
use constant LABEL => 'V'; |
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
446
|
|
30
|
|
|
|
|
|
|
|
31
|
9
|
|
|
10
|
|
50
|
use constant BUFFER => 4096; |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
439
|
|
32
|
9
|
|
|
10
|
|
50
|
use constant HEAD => 512; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
460
|
|
33
|
9
|
|
|
10
|
|
49
|
use constant BLOCK => 512; |
|
10
|
|
|
|
|
31
|
|
|
10
|
|
|
|
|
450
|
|
34
|
|
|
|
|
|
|
|
35
|
10
|
|
|
10
|
|
96
|
use constant COMPRESS_GZIP => 9; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
466
|
|
36
|
10
|
|
|
10
|
|
77
|
use constant COMPRESS_BZIP => 'bzip2'; |
|
10
|
|
|
|
|
39
|
|
|
10
|
|
|
|
|
471
|
|
37
|
10
|
|
|
10
|
|
201
|
use constant COMPRESS_XZ => 'xz'; |
|
10
|
|
|
|
|
26
|
|
|
10
|
|
|
|
|
900
|
|
38
|
|
|
|
|
|
|
|
39
|
10
|
100
|
|
10
|
|
78
|
use constant BLOCK_SIZE => sub { my $n = int($_[0]/BLOCK); $n++ if $_[0] % BLOCK; $n * BLOCK }; |
|
10
|
|
|
|
|
99
|
|
|
10
|
|
|
|
|
958
|
|
|
215
|
|
|
|
|
573
|
|
|
215
|
|
|
|
|
611
|
|
|
215
|
|
|
|
|
411
|
|
40
|
10
|
|
100
|
10
|
|
65
|
use constant TAR_PAD => sub { my $x = shift || return; return "\0" x (BLOCK - ($x % BLOCK) ) }; |
|
10
|
|
|
|
|
85
|
|
|
10
|
|
|
|
|
610
|
|
|
82
|
|
|
|
|
257
|
|
|
82
|
|
|
|
|
606
|
|
41
|
10
|
|
|
10
|
|
62
|
use constant TAR_END => "\0" x BLOCK; |
|
10
|
|
|
|
|
13
|
|
|
10
|
|
|
|
|
740
|
|
42
|
|
|
|
|
|
|
|
43
|
10
|
100
|
|
10
|
|
62
|
use constant READ_ONLY => sub { shift() ? 'rb' : 'r' }; |
|
10
|
|
|
|
|
15
|
|
|
10
|
|
|
|
|
732
|
|
|
76
|
|
|
|
|
625
|
|
44
|
10
|
100
|
|
10
|
|
64
|
use constant WRITE_ONLY => sub { $_[0] ? 'wb' . shift : 'w' }; |
|
10
|
|
|
|
|
69
|
|
|
10
|
|
|
|
|
849
|
|
|
32
|
|
|
|
|
247
|
|
45
|
10
|
100
|
|
10
|
|
123
|
use constant MODE_READ => sub { $_[0] =~ /^r/ ? 1 : 0 }; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
1179
|
|
|
277
|
|
|
|
|
2454
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# Pointless assignment to make -w shut up |
48
|
|
|
|
|
|
|
my $getpwuid; $getpwuid = 'unknown' unless eval { my $f = getpwuid (0); }; |
49
|
|
|
|
|
|
|
my $getgrgid; $getgrgid = 'unknown' unless eval { my $f = getgrgid (0); }; |
50
|
10
|
100
|
50
|
10
|
|
64
|
use constant UNAME => sub { $getpwuid || scalar getpwuid( shift() ) || '' }; |
|
10
|
|
|
|
|
29
|
|
|
10
|
|
|
|
|
776
|
|
|
46
|
|
|
|
|
3450
|
|
51
|
10
|
100
|
50
|
10
|
|
57
|
use constant GNAME => sub { $getgrgid || scalar getgrgid( shift() ) || '' }; |
|
10
|
|
|
|
|
120
|
|
|
10
|
|
|
|
|
565
|
|
|
46
|
|
|
|
|
3500
|
|
52
|
10
|
|
|
10
|
|
97
|
use constant UID => $>; |
|
10
|
|
|
|
|
46
|
|
|
10
|
|
|
|
|
758
|
|
53
|
10
|
|
|
10
|
|
104
|
use constant GID => (split ' ', $) )[0]; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
832
|
|
54
|
|
|
|
|
|
|
|
55
|
10
|
|
|
10
|
|
115
|
use constant MODE => do { 0666 & (0777 & ~umask) }; |
|
10
|
|
|
|
|
25
|
|
|
10
|
|
|
|
|
14
|
|
|
10
|
|
|
|
|
848
|
|
56
|
10
|
|
|
10
|
|
87
|
use constant STRIP_MODE => sub { shift() & 0777 }; |
|
10
|
|
|
|
|
28
|
|
|
10
|
|
|
|
|
577
|
|
|
17
|
|
|
|
|
66
|
|
57
|
10
|
|
|
10
|
|
55
|
use constant CHECK_SUM => " "; |
|
10
|
|
|
|
|
73
|
|
|
10
|
|
|
|
|
484
|
|
58
|
|
|
|
|
|
|
|
59
|
10
|
|
|
10
|
|
54
|
use constant UNPACK => 'a100 a8 a8 a8 a12 a12 a8 a1 a100 A6 a2 a32 a32 a8 a8 a155 x12'; # cdrake - size must be a12 - not A12 - or else screws up huge file sizes (>8gb) |
|
10
|
|
|
|
|
112
|
|
|
10
|
|
|
|
|
430
|
|
60
|
10
|
|
|
10
|
|
67
|
use constant PACK => 'a100 a8 a8 a8 a12 a12 A8 a1 a100 a6 a2 a32 a32 a8 a8 a155 x12'; |
|
10
|
|
|
|
|
131
|
|
|
9
|
|
|
|
|
448
|
|
61
|
9
|
|
|
10
|
|
51
|
use constant NAME_LENGTH => 100; |
|
9
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
467
|
|
62
|
10
|
|
|
10
|
|
54
|
use constant PREFIX_LENGTH => 155; |
|
10
|
|
|
|
|
85
|
|
|
9
|
|
|
|
|
667
|
|
63
|
|
|
|
|
|
|
|
64
|
9
|
50
|
|
10
|
|
54
|
use constant TIME_OFFSET => ($^O eq "MacOS") ? Time::Local::timelocal(0,0,0,1,0,1970) : 0; |
|
10
|
|
|
|
|
42
|
|
|
10
|
|
|
|
|
516
|
|
65
|
10
|
|
|
10
|
|
125
|
use constant MAGIC => "ustar"; |
|
10
|
|
|
|
|
27
|
|
|
10
|
|
|
|
|
458
|
|
66
|
10
|
|
|
10
|
|
124
|
use constant TAR_VERSION => "00"; |
|
9
|
|
|
|
|
14
|
|
|
10
|
|
|
|
|
584
|
|
67
|
10
|
|
|
10
|
|
63
|
use constant LONGLINK_NAME => '././@LongLink'; |
|
10
|
|
|
|
|
97
|
|
|
9
|
|
|
|
|
467
|
|
68
|
10
|
|
|
10
|
|
57
|
use constant PAX_HEADER => 'pax_global_header'; |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
945
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
### allow ZLIB to be turned off using ENV: DEBUG only |
71
|
10
|
|
|
|
|
50
|
use constant ZLIB => do { !$ENV{'PERL5_AT_NO_ZLIB'} and |
72
|
10
|
100
|
|
|
|
135
|
eval { require IO::Zlib }; |
|
10
|
|
|
|
|
594
|
|
73
|
10
|
50
|
33
|
|
|
60755
|
$ENV{'PERL5_AT_NO_ZLIB'} || $@ ? 0 : 1 |
74
|
9
|
|
|
10
|
|
57
|
}; |
|
10
|
|
|
|
|
20
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
### allow BZIP to be turned off using ENV: DEBUG only |
77
|
10
|
|
|
|
|
18
|
use constant BZIP => do { !$ENV{'PERL5_AT_NO_BZIP'} and |
78
|
10
|
50
|
|
|
|
112
|
eval { require IO::Uncompress::Bunzip2; |
|
10
|
|
|
|
|
4767
|
|
79
|
10
|
|
|
|
|
40983
|
require IO::Compress::Bzip2; }; |
80
|
10
|
50
|
33
|
|
|
22636
|
$ENV{'PERL5_AT_NO_BZIP'} || $@ ? 0 : 1 |
81
|
10
|
|
|
10
|
|
115
|
}; |
|
10
|
|
|
|
|
45
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
### allow XZ to be turned off using ENV: DEBUG only |
84
|
10
|
|
|
|
|
16
|
use constant XZ => do { !$ENV{'PERL5_AT_NO_XZ'} and |
85
|
10
|
50
|
|
|
|
99
|
eval { require IO::Compress::Xz; |
|
10
|
|
|
|
|
4606
|
|
86
|
1
|
|
|
|
|
2
|
require IO::Uncompress::UnXz; }; |
87
|
10
|
100
|
33
|
|
|
10501
|
$ENV{'PERL5_AT_NO_XZ'} || $@ ? 0 : 1 |
88
|
10
|
|
|
10
|
|
86
|
}; |
|
10
|
|
|
|
|
18
|
|
89
|
|
|
|
|
|
|
|
90
|
9
|
|
|
10
|
|
67
|
use constant GZIP_MAGIC_NUM => qr/^(?:\037\213|\037\235)/; |
|
10
|
|
|
|
|
36
|
|
|
10
|
|
|
|
|
726
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
# ASCII: B Z h 0 9 |
93
|
10
|
|
|
10
|
|
113
|
use constant BZIP_MAGIC_NUM => qr/^\x42\x5A\x68[\x30-\x39]/; |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
569
|
|
94
|
|
|
|
|
|
|
|
95
|
10
|
|
|
10
|
|
94
|
use constant XZ_MAGIC_NUM => qr/^\xFD\x37\x7A\x58\x5A\x00/; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
640
|
|
96
|
|
|
|
|
|
|
|
97
|
10
|
50
|
33
|
10
|
|
113
|
use constant CAN_CHOWN => sub { ($> == 0 and $^O ne "MacOS" and $^O ne "MSWin32") }; |
|
10
|
|
|
|
|
26
|
|
|
10
|
|
|
|
|
761
|
|
|
266
|
|
|
|
|
10280
|
|
98
|
10
|
|
33
|
10
|
|
67
|
use constant CAN_READLINK => ($^O ne 'MSWin32' and $^O !~ /RISC(?:[ _])?OS/i and $^O ne 'VMS'); |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
773
|
|
99
|
10
|
|
33
|
10
|
|
77
|
use constant ON_UNIX => ($^O ne 'MSWin32' and $^O ne 'MacOS' and $^O ne 'VMS'); |
|
10
|
|
|
|
|
17
|
|
|
10
|
|
|
|
|
611
|
|
100
|
10
|
|
|
10
|
|
57
|
use constant ON_VMS => $^O eq 'VMS'; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
854
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub _list_consts { |
103
|
10
|
|
|
10
|
|
28
|
my $class = shift; |
104
|
10
|
|
|
|
|
18
|
my $pkg = shift; |
105
|
10
|
50
|
|
|
|
72
|
return unless defined $pkg; # some joker might use '0' as a pkg... |
106
|
|
|
|
|
|
|
|
107
|
10
|
|
|
|
|
20
|
my @rv; |
108
|
10
|
|
|
10
|
|
67
|
{ no strict 'refs'; |
|
10
|
|
|
|
|
15
|
|
|
10
|
|
|
|
|
1346
|
|
|
10
|
|
|
|
|
17
|
|
109
|
10
|
|
|
|
|
118
|
my $stash = $pkg . '::'; |
110
|
|
|
|
|
|
|
|
111
|
10
|
|
|
|
|
284
|
for my $name (sort keys %$stash ) { |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
### is it a subentry? |
114
|
496
|
|
|
|
|
2474
|
my $sub = $pkg->can( $name ); |
115
|
496
|
100
|
|
|
|
1282
|
next unless defined $sub; |
116
|
|
|
|
|
|
|
|
117
|
460
|
100
|
66
|
|
|
1501
|
next unless defined prototype($sub) and |
118
|
|
|
|
|
|
|
not length prototype($sub); |
119
|
|
|
|
|
|
|
|
120
|
442
|
|
|
|
|
1442
|
push @rv, $name; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
10
|
|
|
|
|
59489
|
return sort @rv; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; |