line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Archive::Tar::Constant; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
9
|
|
96506
|
use strict; |
|
8
|
|
|
|
|
26
|
|
|
18
|
|
|
|
|
942
|
|
4
|
8
|
|
|
9
|
|
39
|
use warnings; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
318
|
|
5
|
|
|
|
|
|
|
|
6
|
8
|
|
|
9
|
|
45
|
use vars qw[$VERSION @ISA @EXPORT]; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
959
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
BEGIN { |
9
|
8
|
|
|
9
|
|
55
|
require Exporter; |
10
|
|
|
|
|
|
|
|
11
|
8
|
|
|
|
|
24
|
$VERSION = '2.40'; |
12
|
8
|
|
|
|
|
144
|
@ISA = qw[Exporter]; |
13
|
|
|
|
|
|
|
|
14
|
8
|
50
|
|
|
|
403
|
require Time::Local if $^O eq "MacOS"; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
@EXPORT = Archive::Tar::Constant->_list_consts( __PACKAGE__ ); |
18
|
|
|
|
|
|
|
|
19
|
8
|
|
|
9
|
|
64
|
use constant FILE => 0; |
|
8
|
|
|
|
|
74
|
|
|
8
|
|
|
|
|
571
|
|
20
|
8
|
|
|
9
|
|
48
|
use constant HARDLINK => 1; |
|
8
|
|
|
|
|
40
|
|
|
8
|
|
|
|
|
430
|
|
21
|
8
|
|
|
9
|
|
49
|
use constant SYMLINK => 2; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
462
|
|
22
|
8
|
|
|
9
|
|
47
|
use constant CHARDEV => 3; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
611
|
|
23
|
8
|
|
|
9
|
|
54
|
use constant BLOCKDEV => 4; |
|
8
|
|
|
|
|
37
|
|
|
8
|
|
|
|
|
478
|
|
24
|
8
|
|
|
9
|
|
50
|
use constant DIR => 5; |
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
438
|
|
25
|
8
|
|
|
9
|
|
47
|
use constant FIFO => 6; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
399
|
|
26
|
8
|
|
|
9
|
|
47
|
use constant SOCKET => 8; |
|
8
|
|
|
|
|
22
|
|
|
8
|
|
|
|
|
379
|
|
27
|
8
|
|
|
9
|
|
55
|
use constant UNKNOWN => 9; |
|
8
|
|
|
|
|
26
|
|
|
8
|
|
|
|
|
431
|
|
28
|
8
|
|
|
9
|
|
51
|
use constant LONGLINK => 'L'; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
424
|
|
29
|
8
|
|
|
9
|
|
49
|
use constant LABEL => 'V'; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
435
|
|
30
|
|
|
|
|
|
|
|
31
|
8
|
|
|
9
|
|
51
|
use constant BUFFER => 4096; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
487
|
|
32
|
8
|
|
|
9
|
|
49
|
use constant HEAD => 512; |
|
8
|
|
|
|
|
23
|
|
|
8
|
|
|
|
|
417
|
|
33
|
8
|
|
|
9
|
|
55
|
use constant BLOCK => 512; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
431
|
|
34
|
|
|
|
|
|
|
|
35
|
9
|
|
|
9
|
|
83
|
use constant COMPRESS_GZIP => 9; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
409
|
|
36
|
9
|
|
|
9
|
|
86
|
use constant COMPRESS_BZIP => 'bzip2'; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
421
|
|
37
|
9
|
|
|
9
|
|
180
|
use constant COMPRESS_XZ => 'xz'; |
|
9
|
|
|
|
|
28
|
|
|
9
|
|
|
|
|
925
|
|
38
|
|
|
|
|
|
|
|
39
|
9
|
100
|
|
9
|
|
85
|
use constant BLOCK_SIZE => sub { my $n = int($_[0]/BLOCK); $n++ if $_[0] % BLOCK; $n * BLOCK }; |
|
9
|
|
|
|
|
77
|
|
|
9
|
|
|
|
|
886
|
|
|
203
|
|
|
|
|
607
|
|
|
203
|
|
|
|
|
566
|
|
|
203
|
|
|
|
|
434
|
|
40
|
9
|
|
100
|
9
|
|
65
|
use constant TAR_PAD => sub { my $x = shift || return; return "\0" x (BLOCK - ($x % BLOCK) ) }; |
|
9
|
|
|
|
|
71
|
|
|
9
|
|
|
|
|
580
|
|
|
81
|
|
|
|
|
246
|
|
|
81
|
|
|
|
|
755
|
|
41
|
9
|
|
|
9
|
|
56
|
use constant TAR_END => "\0" x BLOCK; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
685
|
|
42
|
|
|
|
|
|
|
|
43
|
9
|
100
|
|
9
|
|
66
|
use constant READ_ONLY => sub { shift() ? 'rb' : 'r' }; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
716
|
|
|
69
|
|
|
|
|
868
|
|
44
|
9
|
100
|
|
9
|
|
65
|
use constant WRITE_ONLY => sub { $_[0] ? 'wb' . shift : 'w' }; |
|
9
|
|
|
|
|
57
|
|
|
9
|
|
|
|
|
766
|
|
|
31
|
|
|
|
|
367
|
|
45
|
9
|
100
|
|
9
|
|
106
|
use constant MODE_READ => sub { $_[0] =~ /^r/ ? 1 : 0 }; |
|
9
|
|
|
|
|
35
|
|
|
9
|
|
|
|
|
1077
|
|
|
253
|
|
|
|
|
2508
|
|
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
|
9
|
100
|
50
|
9
|
|
69
|
use constant UNAME => sub { $getpwuid || scalar getpwuid( shift() ) || '' }; |
|
9
|
|
|
|
|
38
|
|
|
9
|
|
|
|
|
693
|
|
|
46
|
|
|
|
|
4308
|
|
51
|
9
|
100
|
50
|
9
|
|
54
|
use constant GNAME => sub { $getgrgid || scalar getgrgid( shift() ) || '' }; |
|
9
|
|
|
|
|
80
|
|
|
9
|
|
|
|
|
547
|
|
|
46
|
|
|
|
|
3712
|
|
52
|
9
|
|
|
9
|
|
150
|
use constant UID => $>; |
|
9
|
|
|
|
|
37
|
|
|
9
|
|
|
|
|
809
|
|
53
|
9
|
|
|
9
|
|
104
|
use constant GID => (split ' ', $) )[0]; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
786
|
|
54
|
|
|
|
|
|
|
|
55
|
9
|
|
|
9
|
|
92
|
use constant MODE => do { 0666 & (0777 & ~umask) }; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
729
|
|
56
|
9
|
|
|
9
|
|
60
|
use constant STRIP_MODE => sub { shift() & 0777 }; |
|
9
|
|
|
|
|
25
|
|
|
9
|
|
|
|
|
545
|
|
|
17
|
|
|
|
|
76
|
|
57
|
9
|
|
|
9
|
|
54
|
use constant CHECK_SUM => " "; |
|
9
|
|
|
|
|
69
|
|
|
9
|
|
|
|
|
434
|
|
58
|
|
|
|
|
|
|
|
59
|
9
|
|
|
9
|
|
57
|
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) |
|
9
|
|
|
|
|
159
|
|
|
9
|
|
|
|
|
463
|
|
60
|
9
|
|
|
9
|
|
51
|
use constant PACK => 'a100 a8 a8 a8 a12 a12 A8 a1 a100 a6 a2 a32 a32 a8 a8 a155 x12'; |
|
9
|
|
|
|
|
197
|
|
|
8
|
|
|
|
|
424
|
|
61
|
8
|
|
|
9
|
|
61
|
use constant NAME_LENGTH => 100; |
|
8
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
440
|
|
62
|
9
|
|
|
9
|
|
60
|
use constant PREFIX_LENGTH => 155; |
|
9
|
|
|
|
|
113
|
|
|
8
|
|
|
|
|
631
|
|
63
|
|
|
|
|
|
|
|
64
|
8
|
50
|
|
9
|
|
57
|
use constant TIME_OFFSET => ($^O eq "MacOS") ? Time::Local::timelocal(0,0,0,1,0,1970) : 0; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
546
|
|
65
|
9
|
|
|
9
|
|
126
|
use constant MAGIC => "ustar"; |
|
9
|
|
|
|
|
30
|
|
|
9
|
|
|
|
|
419
|
|
66
|
9
|
|
|
9
|
|
125
|
use constant TAR_VERSION => "00"; |
|
8
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
477
|
|
67
|
9
|
|
|
9
|
|
53
|
use constant LONGLINK_NAME => '././@LongLink'; |
|
9
|
|
|
|
|
119
|
|
|
8
|
|
|
|
|
446
|
|
68
|
9
|
|
|
9
|
|
64
|
use constant PAX_HEADER => 'pax_global_header'; |
|
9
|
|
|
|
|
34
|
|
|
9
|
|
|
|
|
1008
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
### allow ZLIB to be turned off using ENV: DEBUG only |
71
|
9
|
|
|
|
|
69
|
use constant ZLIB => do { !$ENV{'PERL5_AT_NO_ZLIB'} and |
72
|
9
|
100
|
|
|
|
125
|
eval { require IO::Zlib }; |
|
9
|
|
|
|
|
604
|
|
73
|
9
|
50
|
33
|
|
|
68960
|
$ENV{'PERL5_AT_NO_ZLIB'} || $@ ? 0 : 1 |
74
|
8
|
|
|
9
|
|
54
|
}; |
|
9
|
|
|
|
|
21
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
### allow BZIP to be turned off using ENV: DEBUG only |
77
|
9
|
|
|
|
|
17
|
use constant BZIP => do { !$ENV{'PERL5_AT_NO_BZIP'} and |
78
|
9
|
50
|
|
|
|
134
|
eval { require IO::Uncompress::Bunzip2; |
|
9
|
|
|
|
|
5366
|
|
79
|
9
|
|
|
|
|
41111
|
require IO::Compress::Bzip2; }; |
80
|
9
|
50
|
33
|
|
|
22352
|
$ENV{'PERL5_AT_NO_BZIP'} || $@ ? 0 : 1 |
81
|
9
|
|
|
9
|
|
126
|
}; |
|
9
|
|
|
|
|
21
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
### allow XZ to be turned off using ENV: DEBUG only |
84
|
9
|
|
|
|
|
26
|
use constant XZ => do { !$ENV{'PERL5_AT_NO_XZ'} and |
85
|
9
|
50
|
|
|
|
127
|
eval { require IO::Compress::Xz; |
|
9
|
|
|
|
|
4624
|
|
86
|
1
|
|
|
|
|
8
|
require IO::Uncompress::UnXz; }; |
87
|
9
|
100
|
33
|
|
|
10584
|
$ENV{'PERL5_AT_NO_XZ'} || $@ ? 0 : 1 |
88
|
9
|
|
|
9
|
|
79
|
}; |
|
9
|
|
|
|
|
20
|
|
89
|
|
|
|
|
|
|
|
90
|
8
|
|
|
9
|
|
63
|
use constant GZIP_MAGIC_NUM => qr/^(?:\037\213|\037\235)/; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
708
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
# ASCII: B Z h 0 9 |
93
|
9
|
|
|
9
|
|
109
|
use constant BZIP_MAGIC_NUM => qr/^\x42\x5A\x68[\x30-\x39]/; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
515
|
|
94
|
|
|
|
|
|
|
|
95
|
9
|
|
|
9
|
|
107
|
use constant XZ_MAGIC_NUM => qr/^\xFD\x37\x7A\x58\x5A\x00/; |
|
9
|
|
|
|
|
33
|
|
|
9
|
|
|
|
|
621
|
|
96
|
|
|
|
|
|
|
|
97
|
9
|
50
|
33
|
9
|
|
92
|
use constant CAN_CHOWN => sub { ($> == 0 and $^O ne "MacOS" and $^O ne "MSWin32") }; |
|
9
|
|
|
|
|
27
|
|
|
9
|
|
|
|
|
701
|
|
|
111
|
|
|
|
|
5307
|
|
98
|
9
|
|
33
|
9
|
|
57
|
use constant CAN_READLINK => ($^O ne 'MSWin32' and $^O !~ /RISC(?:[ _])?OS/i and $^O ne 'VMS'); |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
638
|
|
99
|
9
|
|
33
|
9
|
|
55
|
use constant ON_UNIX => ($^O ne 'MSWin32' and $^O ne 'MacOS' and $^O ne 'VMS'); |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
623
|
|
100
|
9
|
|
|
9
|
|
59
|
use constant ON_VMS => $^O eq 'VMS'; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
760
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub _list_consts { |
103
|
9
|
|
|
9
|
|
27
|
my $class = shift; |
104
|
9
|
|
|
|
|
15
|
my $pkg = shift; |
105
|
9
|
50
|
|
|
|
71
|
return unless defined $pkg; # some joker might use '0' as a pkg... |
106
|
|
|
|
|
|
|
|
107
|
9
|
|
|
|
|
20
|
my @rv; |
108
|
9
|
|
|
9
|
|
79
|
{ no strict 'refs'; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
1347
|
|
|
9
|
|
|
|
|
11
|
|
109
|
9
|
|
|
|
|
135
|
my $stash = $pkg . '::'; |
110
|
|
|
|
|
|
|
|
111
|
9
|
|
|
|
|
290
|
for my $name (sort keys %$stash ) { |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
### is it a subentry? |
114
|
441
|
|
|
|
|
2306
|
my $sub = $pkg->can( $name ); |
115
|
441
|
100
|
|
|
|
836
|
next unless defined $sub; |
116
|
|
|
|
|
|
|
|
117
|
409
|
100
|
66
|
|
|
1384
|
next unless defined prototype($sub) and |
118
|
|
|
|
|
|
|
not length prototype($sub); |
119
|
|
|
|
|
|
|
|
120
|
393
|
|
|
|
|
1438
|
push @rv, $name; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
9
|
|
|
|
|
64688
|
return sort @rv; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; |