line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Java::Release; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
76349
|
use base qw(Exporter); |
|
3
|
|
|
|
|
27
|
|
|
3
|
|
|
|
|
389
|
|
4
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
61
|
|
5
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
13
|
|
|
3
|
|
|
|
|
96
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
1305
|
use Error::Pure qw(err); |
|
3
|
|
|
|
|
21145
|
|
|
3
|
|
|
|
|
56
|
|
8
|
3
|
|
|
3
|
|
3470
|
use Java::Release::Obj; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
88
|
|
9
|
3
|
|
|
3
|
|
21
|
use Readonly; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1251
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Constants. |
12
|
|
|
|
|
|
|
Readonly::Array our @EXPORT => qw(parse_java_jdk_release); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = 0.04; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Parse Java JDK release. |
17
|
|
|
|
|
|
|
sub parse_java_jdk_release { |
18
|
8
|
|
|
8
|
1
|
95
|
my $release_name = shift; |
19
|
|
|
|
|
|
|
|
20
|
8
|
|
|
|
|
16
|
my $obj; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# j2sdk-1_3_1_20-linux-i586.bin |
23
|
8
|
100
|
|
|
|
90
|
if ($release_name =~ m/^j2sdk-([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)-(linux)-(i586).bin$/ms) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
24
|
1
|
|
|
|
|
13
|
$obj = Java::Release::Obj->new( |
25
|
|
|
|
|
|
|
arch => $6, |
26
|
|
|
|
|
|
|
interim => $3, |
27
|
|
|
|
|
|
|
os => $5, |
28
|
|
|
|
|
|
|
release => $2, |
29
|
|
|
|
|
|
|
update => $4, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# jdk-8u151-linux-i586.tar.gz |
33
|
|
|
|
|
|
|
} elsif ($release_name =~ m/^jdk-([0-9]+)(u([0-9]+))?-(linux)-(i586|x64|amd64|arm-vfp-hflt|arm32-vfp-hflt|arm64-vfp-hflt)\.(bin|tar\.gz)$/ms) { |
34
|
4
|
|
|
|
|
25
|
$obj = Java::Release::Obj->new( |
35
|
|
|
|
|
|
|
arch => $5, |
36
|
|
|
|
|
|
|
os => $4, |
37
|
|
|
|
|
|
|
release => $1, |
38
|
|
|
|
|
|
|
update => $3, |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# jdk-13.0.2_linux-x64_bin.tar.gz |
42
|
|
|
|
|
|
|
} elsif ($release_name =~ m/^jdk-([0-9]+)(\.([0-9]+))?(\.([0-9]+))?(\.([0-9]+))?_(linux)-(i586|x64|amd64|arm-vfp-hflt|arm32-vfp-hflt|arm64-vfp-hflt)_bin.tar.gz$/ms) { |
43
|
2
|
|
|
|
|
15
|
$obj = Java::Release::Obj->new( |
44
|
|
|
|
|
|
|
arch => $9, |
45
|
|
|
|
|
|
|
interim => $3, |
46
|
|
|
|
|
|
|
os => $8, |
47
|
|
|
|
|
|
|
patch => $7, |
48
|
|
|
|
|
|
|
release => $1, |
49
|
|
|
|
|
|
|
update => $5, |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
} else { |
52
|
1
|
|
|
|
|
6
|
err "Unsupported release.", |
53
|
|
|
|
|
|
|
'release_name', $release_name; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
7
|
|
|
|
|
699
|
return $obj; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=pod |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=encoding utf8 |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 NAME |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Java::Release - Parse Java release archive. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SYNOPSIS |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
use Java::Release qw(parse_java_jdk_release); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
my $release_hr = parse_java_jdk_release($file); |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 SUBROUTINES |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 C<parse_java_jdk_release> |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
my $release_hr = parse_java_jdk_release($file); |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Parse Java JDK release name. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Returns reference to hash with information about release. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 ERRORS |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
parse_java_jdk_release(): |
90
|
|
|
|
|
|
|
Unsupported release. |
91
|
|
|
|
|
|
|
release_name: %s |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 EXAMPLE |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
use strict; |
96
|
|
|
|
|
|
|
use warnings; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
use Data::Printer; |
99
|
|
|
|
|
|
|
use Java::Release qw(parse_java_jdk_release); |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
if (@ARGV < 1) { |
102
|
|
|
|
|
|
|
print STDERR "Usage: $0 java_jdk_release\n"; |
103
|
|
|
|
|
|
|
exit 1; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
my $java_jdk_release = $ARGV[0]; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
# Parse Java JDK release name. |
108
|
|
|
|
|
|
|
my $release_hr = parse_java_jdk_release($java_jdk_release); |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
p $release_hr; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
# Output like: |
113
|
|
|
|
|
|
|
# Usage: qr{\w+} java_jdk_release |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
L<Error::Pure>, |
118
|
|
|
|
|
|
|
L<Exporter>, |
119
|
|
|
|
|
|
|
L<Readonly>. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head1 REPOSITORY |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
L<https://github.com/michal-josef-spacek/Java-Release> |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head1 AUTHOR |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Michal Josef Špaček L<mailto:skim@cpan.org> |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
L<http://skim.cz> |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
© 2020-2021 Michal Josef Špaček |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
BSD 2-Clause License |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head1 DEDICATION |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Thanks for L<java-package|https://salsa.debian.org/java-team/java-package.git> project. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=head1 VERSION |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
0.04 |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=cut |