line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Archive::Tar::Constant; |
2
|
|
|
|
|
|
|
|
3
|
19
|
|
|
10
|
|
91268
|
use strict; |
|
9
|
|
|
|
|
27
|
|
|
19
|
|
|
|
|
931
|
|
4
|
9
|
|
|
10
|
|
45
|
use warnings; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
309
|
|
5
|
|
|
|
|
|
|
|
6
|
9
|
|
|
10
|
|
55
|
use vars qw[$VERSION @ISA @EXPORT]; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
940
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
BEGIN { |
9
|
9
|
|
|
10
|
|
67
|
require Exporter; |
10
|
|
|
|
|
|
|
|
11
|
9
|
|
|
|
|
28
|
$VERSION = '3.00'; |
12
|
9
|
|
|
|
|
148
|
@ISA = qw[Exporter]; |
13
|
|
|
|
|
|
|
|
14
|
9
|
50
|
|
|
|
479
|
require Time::Local if $^O eq "MacOS"; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
@EXPORT = Archive::Tar::Constant->_list_consts( __PACKAGE__ ); |
18
|
|
|
|
|
|
|
|
19
|
9
|
|
|
10
|
|
64
|
use constant FILE => 0; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
601
|
|
20
|
9
|
|
|
10
|
|
52
|
use constant HARDLINK => 1; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
515
|
|
21
|
9
|
|
|
10
|
|
52
|
use constant SYMLINK => 2; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
434
|
|
22
|
9
|
|
|
10
|
|
49
|
use constant CHARDEV => 3; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
612
|
|
23
|
9
|
|
|
10
|
|
57
|
use constant BLOCKDEV => 4; |
|
9
|
|
|
|
|
25
|
|
|
9
|
|
|
|
|
428
|
|
24
|
9
|
|
|
10
|
|
48
|
use constant DIR => 5; |
|
9
|
|
|
|
|
31
|
|
|
9
|
|
|
|
|
402
|
|
25
|
9
|
|
|
10
|
|
74
|
use constant FIFO => 6; |
|
9
|
|
|
|
|
32
|
|
|
9
|
|
|
|
|
411
|
|
26
|
9
|
|
|
10
|
|
51
|
use constant SOCKET => 8; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
397
|
|
27
|
9
|
|
|
10
|
|
75
|
use constant UNKNOWN => 9; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
458
|
|
28
|
9
|
|
|
10
|
|
51
|
use constant LONGLINK => 'L'; |
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
436
|
|
29
|
9
|
|
|
10
|
|
85
|
use constant LABEL => 'V'; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
416
|
|
30
|
|
|
|
|
|
|
|
31
|
9
|
|
|
10
|
|
47
|
use constant BUFFER => 4096; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
437
|
|
32
|
9
|
|
|
10
|
|
52
|
use constant HEAD => 512; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
419
|
|
33
|
9
|
|
|
10
|
|
47
|
use constant BLOCK => 512; |
|
10
|
|
|
|
|
36
|
|
|
10
|
|
|
|
|
486
|
|
34
|
|
|
|
|
|
|
|
35
|
10
|
|
|
10
|
|
91
|
use constant COMPRESS_GZIP => 9; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
464
|
|
36
|
10
|
|
|
10
|
|
96
|
use constant COMPRESS_BZIP => 'bzip2'; |
|
10
|
|
|
|
|
38
|
|
|
10
|
|
|
|
|
438
|
|
37
|
10
|
|
|
10
|
|
175
|
use constant COMPRESS_XZ => 'xz'; |
|
10
|
|
|
|
|
28
|
|
|
10
|
|
|
|
|
910
|
|
38
|
|
|
|
|
|
|
|
39
|
10
|
100
|
|
10
|
|
73
|
use constant BLOCK_SIZE => sub { my $n = int($_[0]/BLOCK); $n++ if $_[0] % BLOCK; $n * BLOCK }; |
|
10
|
|
|
|
|
90
|
|
|
10
|
|
|
|
|
966
|
|
|
215
|
|
|
|
|
549
|
|
|
215
|
|
|
|
|
592
|
|
|
215
|
|
|
|
|
442
|
|
40
|
10
|
|
100
|
10
|
|
63
|
use constant TAR_PAD => sub { my $x = shift || return; return "\0" x (BLOCK - ($x % BLOCK) ) }; |
|
10
|
|
|
|
|
79
|
|
|
10
|
|
|
|
|
613
|
|
|
82
|
|
|
|
|
212
|
|
|
82
|
|
|
|
|
649
|
|
41
|
10
|
|
|
10
|
|
59
|
use constant TAR_END => "\0" x BLOCK; |
|
10
|
|
|
|
|
31
|
|
|
10
|
|
|
|
|
693
|
|
42
|
|
|
|
|
|
|
|
43
|
10
|
100
|
|
10
|
|
64
|
use constant READ_ONLY => sub { shift() ? 'rb' : 'r' }; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
702
|
|
|
76
|
|
|
|
|
663
|
|
44
|
10
|
100
|
|
10
|
|
67
|
use constant WRITE_ONLY => sub { $_[0] ? 'wb' . shift : 'w' }; |
|
10
|
|
|
|
|
66
|
|
|
10
|
|
|
|
|
832
|
|
|
32
|
|
|
|
|
297
|
|
45
|
10
|
100
|
|
10
|
|
121
|
use constant MODE_READ => sub { $_[0] =~ /^r/ ? 1 : 0 }; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
1137
|
|
|
277
|
|
|
|
|
2461
|
|
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
|
|
60
|
use constant UNAME => sub { $getpwuid || scalar getpwuid( shift() ) || '' }; |
|
10
|
|
|
|
|
32
|
|
|
10
|
|
|
|
|
771
|
|
|
46
|
|
|
|
|
3681
|
|
51
|
10
|
100
|
50
|
10
|
|
57
|
use constant GNAME => sub { $getgrgid || scalar getgrgid( shift() ) || '' }; |
|
10
|
|
|
|
|
83
|
|
|
10
|
|
|
|
|
569
|
|
|
46
|
|
|
|
|
3476
|
|
52
|
10
|
|
|
10
|
|
92
|
use constant UID => $>; |
|
10
|
|
|
|
|
38
|
|
|
10
|
|
|
|
|
763
|
|
53
|
10
|
|
|
10
|
|
100
|
use constant GID => (split ' ', $) )[0]; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
814
|
|
54
|
|
|
|
|
|
|
|
55
|
10
|
|
|
10
|
|
128
|
use constant MODE => do { 0666 & (0777 & ~umask) }; |
|
10
|
|
|
|
|
56
|
|
|
10
|
|
|
|
|
34
|
|
|
10
|
|
|
|
|
757
|
|
56
|
10
|
|
|
10
|
|
63
|
use constant STRIP_MODE => sub { shift() & 0777 }; |
|
10
|
|
|
|
|
17
|
|
|
10
|
|
|
|
|
542
|
|
|
17
|
|
|
|
|
74
|
|
57
|
10
|
|
|
10
|
|
59
|
use constant CHECK_SUM => " "; |
|
10
|
|
|
|
|
69
|
|
|
10
|
|
|
|
|
460
|
|
58
|
|
|
|
|
|
|
|
59
|
10
|
|
|
10
|
|
55
|
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
|
|
|
|
|
106
|
|
|
10
|
|
|
|
|
474
|
|
60
|
10
|
|
|
10
|
|
59
|
use constant PACK => 'a100 a8 a8 a8 a12 a12 A8 a1 a100 a6 a2 a32 a32 a8 a8 a155 x12'; |
|
10
|
|
|
|
|
154
|
|
|
9
|
|
|
|
|
420
|
|
61
|
9
|
|
|
10
|
|
53
|
use constant NAME_LENGTH => 100; |
|
9
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
422
|
|
62
|
10
|
|
|
10
|
|
52
|
use constant PREFIX_LENGTH => 155; |
|
10
|
|
|
|
|
97
|
|
|
9
|
|
|
|
|
744
|
|
63
|
|
|
|
|
|
|
|
64
|
9
|
50
|
|
10
|
|
88
|
use constant TIME_OFFSET => ($^O eq "MacOS") ? Time::Local::timelocal(0,0,0,1,0,1970) : 0; |
|
10
|
|
|
|
|
30
|
|
|
10
|
|
|
|
|
524
|
|
65
|
10
|
|
|
10
|
|
120
|
use constant MAGIC => "ustar"; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
465
|
|
66
|
10
|
|
|
10
|
|
122
|
use constant TAR_VERSION => "00"; |
|
9
|
|
|
|
|
14
|
|
|
10
|
|
|
|
|
574
|
|
67
|
10
|
|
|
10
|
|
57
|
use constant LONGLINK_NAME => '././@LongLink'; |
|
10
|
|
|
|
|
98
|
|
|
9
|
|
|
|
|
441
|
|
68
|
10
|
|
|
10
|
|
56
|
use constant PAX_HEADER => 'pax_global_header'; |
|
10
|
|
|
|
|
14
|
|
|
10
|
|
|
|
|
991
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
### allow ZLIB to be turned off using ENV: DEBUG only |
71
|
10
|
|
|
|
|
45
|
use constant ZLIB => do { !$ENV{'PERL5_AT_NO_ZLIB'} and |
72
|
10
|
100
|
|
|
|
129
|
eval { require IO::Zlib }; |
|
10
|
|
|
|
|
564
|
|
73
|
10
|
50
|
33
|
|
|
59495
|
$ENV{'PERL5_AT_NO_ZLIB'} || $@ ? 0 : 1 |
74
|
9
|
|
|
10
|
|
61
|
}; |
|
10
|
|
|
|
|
23
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
### allow BZIP to be turned off using ENV: DEBUG only |
77
|
10
|
|
|
|
|
21
|
use constant BZIP => do { !$ENV{'PERL5_AT_NO_BZIP'} and |
78
|
10
|
50
|
|
|
|
141
|
eval { require IO::Uncompress::Bunzip2; |
|
10
|
|
|
|
|
4924
|
|
79
|
10
|
|
|
|
|
41072
|
require IO::Compress::Bzip2; }; |
80
|
10
|
50
|
33
|
|
|
23201
|
$ENV{'PERL5_AT_NO_BZIP'} || $@ ? 0 : 1 |
81
|
10
|
|
|
10
|
|
116
|
}; |
|
10
|
|
|
|
|
42
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
### allow XZ to be turned off using ENV: DEBUG only |
84
|
10
|
|
|
|
|
17
|
use constant XZ => do { !$ENV{'PERL5_AT_NO_XZ'} and |
85
|
10
|
50
|
|
|
|
119
|
eval { require IO::Compress::Xz; |
|
10
|
|
|
|
|
4343
|
|
86
|
1
|
|
|
|
|
2
|
require IO::Uncompress::UnXz; }; |
87
|
10
|
100
|
33
|
|
|
10357
|
$ENV{'PERL5_AT_NO_XZ'} || $@ ? 0 : 1 |
88
|
10
|
|
|
10
|
|
72
|
}; |
|
10
|
|
|
|
|
19
|
|
89
|
|
|
|
|
|
|
|
90
|
9
|
|
|
10
|
|
72
|
use constant GZIP_MAGIC_NUM => qr/^(?:\037\213|\037\235)/; |
|
10
|
|
|
|
|
40
|
|
|
10
|
|
|
|
|
715
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
# ASCII: B Z h 0 9 |
93
|
10
|
|
|
10
|
|
114
|
use constant BZIP_MAGIC_NUM => qr/^\x42\x5A\x68[\x30-\x39]/; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
551
|
|
94
|
|
|
|
|
|
|
|
95
|
10
|
|
|
10
|
|
90
|
use constant XZ_MAGIC_NUM => qr/^\xFD\x37\x7A\x58\x5A\x00/; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
648
|
|
96
|
|
|
|
|
|
|
|
97
|
10
|
50
|
33
|
10
|
|
109
|
use constant CAN_CHOWN => sub { ($> == 0 and $^O ne "MacOS" and $^O ne "MSWin32") }; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
743
|
|
|
296
|
|
|
|
|
10572
|
|
98
|
10
|
|
33
|
10
|
|
58
|
use constant CAN_READLINK => ($^O ne 'MSWin32' and $^O !~ /RISC(?:[ _])?OS/i and $^O ne 'VMS'); |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
714
|
|
99
|
10
|
|
33
|
10
|
|
85
|
use constant ON_UNIX => ($^O ne 'MSWin32' and $^O ne 'MacOS' and $^O ne 'VMS'); |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
600
|
|
100
|
10
|
|
|
10
|
|
58
|
use constant ON_VMS => $^O eq 'VMS'; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
774
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub _list_consts { |
103
|
10
|
|
|
10
|
|
27
|
my $class = shift; |
104
|
10
|
|
|
|
|
16
|
my $pkg = shift; |
105
|
10
|
50
|
|
|
|
71
|
return unless defined $pkg; # some joker might use '0' as a pkg... |
106
|
|
|
|
|
|
|
|
107
|
10
|
|
|
|
|
22
|
my @rv; |
108
|
10
|
|
|
10
|
|
64
|
{ no strict 'refs'; |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
1297
|
|
|
10
|
|
|
|
|
20
|
|
109
|
10
|
|
|
|
|
152
|
my $stash = $pkg . '::'; |
110
|
|
|
|
|
|
|
|
111
|
10
|
|
|
|
|
291
|
for my $name (sort keys %$stash ) { |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
### is it a subentry? |
114
|
496
|
|
|
|
|
2478
|
my $sub = $pkg->can( $name ); |
115
|
496
|
100
|
|
|
|
934
|
next unless defined $sub; |
116
|
|
|
|
|
|
|
|
117
|
460
|
100
|
66
|
|
|
1487
|
next unless defined prototype($sub) and |
118
|
|
|
|
|
|
|
not length prototype($sub); |
119
|
|
|
|
|
|
|
|
120
|
442
|
|
|
|
|
1396
|
push @rv, $name; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
10
|
|
|
|
|
59094
|
return sort @rv; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; |