line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dist::Zooky::DistIni::Prereqs; |
2
|
|
|
|
|
|
|
$Dist::Zooky::DistIni::Prereqs::VERSION = '0.20'; |
3
|
|
|
|
|
|
|
# ABSTRACT: Dist::Zooky DistIni plugin to handle prereqs |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
6
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
45
|
|
6
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
36
|
|
7
|
2
|
|
|
2
|
|
8
|
use Moose; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
14
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'Dist::Zooky::Role::DistIni'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $template = q| |
12
|
|
|
|
|
|
|
{{ |
13
|
|
|
|
|
|
|
if ( keys %configure ) { |
14
|
|
|
|
|
|
|
$OUT .= "[Prereqs / ConfigureRequires]\n"; |
15
|
|
|
|
|
|
|
$OUT .= join(' = ', $_, $configure{$_}) . "\n" for sort keys %configure; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
else { |
18
|
|
|
|
|
|
|
$OUT .= ';[Prereqs / ConfigureRequires]'; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
}} |
21
|
|
|
|
|
|
|
{{ |
22
|
|
|
|
|
|
|
if ( keys %build ) { |
23
|
|
|
|
|
|
|
$OUT .= "[Prereqs / BuildRequires]\n"; |
24
|
|
|
|
|
|
|
$OUT .= join(' = ', $_, $build{$_}) . "\n" for sort keys %build; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
else { |
27
|
|
|
|
|
|
|
$OUT .= ';[Prereqs / BuildRequires]'; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
}} |
30
|
|
|
|
|
|
|
{{ |
31
|
|
|
|
|
|
|
if ( keys %runtime ) { |
32
|
|
|
|
|
|
|
$OUT .= "[Prereqs]\n"; |
33
|
|
|
|
|
|
|
$OUT .= join(' = ', $_, $runtime{$_}) . "\n" for sort keys %runtime; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
else { |
36
|
|
|
|
|
|
|
$OUT .= ';[Prereqs]'; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
}} |
39
|
|
|
|
|
|
|
|; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub content { |
42
|
2
|
|
|
2
|
1
|
3
|
my $self = shift; |
43
|
2
|
|
|
|
|
4
|
my %stash; |
44
|
|
|
|
|
|
|
$stash{$_} = $self->metadata->{prereqs}->{$_}->{requires} |
45
|
2
|
|
|
|
|
57
|
for qw(configure build runtime); |
46
|
2
|
|
|
|
|
10
|
my $content = $self->fill_in_string( |
47
|
|
|
|
|
|
|
$template, |
48
|
|
|
|
|
|
|
\%stash, |
49
|
|
|
|
|
|
|
); |
50
|
2
|
|
|
|
|
1905
|
return $content; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
54
|
2
|
|
|
2
|
|
10064
|
no Moose; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
9
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
qq[WHAT DO YOU REQUIRE?]; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=pod |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=encoding UTF-8 |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 NAME |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Dist::Zooky::DistIni::Prereqs - Dist::Zooky DistIni plugin to handle prereqs |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 VERSION |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
version 0.20 |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 METHODS |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=over |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item C<content> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Returns C<content> for adding to C<dist.ini>. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=back |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 AUTHOR |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Chris Williams <chris@bingosnet.co.uk> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Chris Williams. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
91
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |