line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Generates a stub 03modlist.data.gz file |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Pinto::ModlistWriter; |
4
|
|
|
|
|
|
|
|
5
|
51
|
|
|
51
|
|
339
|
use Moose; |
|
51
|
|
|
|
|
107
|
|
|
51
|
|
|
|
|
442
|
|
6
|
51
|
|
|
51
|
|
335288
|
use MooseX::StrictConstructor; |
|
51
|
|
|
|
|
129
|
|
|
51
|
|
|
|
|
509
|
|
7
|
51
|
|
|
51
|
|
161454
|
use MooseX::MarkAsMethods ( autoclean => 1 ); |
|
51
|
|
|
|
|
129
|
|
|
51
|
|
|
|
|
457
|
|
8
|
|
|
|
|
|
|
|
9
|
51
|
|
|
51
|
|
177781
|
use IO::Zlib; |
|
51
|
|
|
|
|
156
|
|
|
51
|
|
|
|
|
517
|
|
10
|
51
|
|
|
51
|
|
3115
|
use HTTP::Date qw(time2str); |
|
51
|
|
|
|
|
114
|
|
|
51
|
|
|
|
|
4059
|
|
11
|
|
|
|
|
|
|
|
12
|
51
|
|
|
51
|
|
322
|
use Pinto::Types qw(File); |
|
51
|
|
|
|
|
100
|
|
|
51
|
|
|
|
|
613
|
|
13
|
51
|
|
|
51
|
|
315921
|
use Pinto::Util qw(debug throw); |
|
51
|
|
|
|
|
133
|
|
|
51
|
|
|
|
|
20503
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '0.14'; # VERSION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has stack => ( |
22
|
|
|
|
|
|
|
is => 'ro', |
23
|
|
|
|
|
|
|
isa => 'Pinto::Schema::Result::Stack', |
24
|
|
|
|
|
|
|
required => 1, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
has modlist_file => ( |
28
|
|
|
|
|
|
|
is => 'ro', |
29
|
|
|
|
|
|
|
isa => File, |
30
|
|
|
|
|
|
|
default => sub { $_[0]->stack->modules_dir->file('03modlist.data.gz') }, |
31
|
|
|
|
|
|
|
lazy => 1, |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub write_modlist { |
37
|
137
|
|
|
137
|
0
|
432
|
my ($self) = @_; |
38
|
|
|
|
|
|
|
|
39
|
137
|
|
|
|
|
3872
|
my $stack = $self->stack; |
40
|
137
|
|
|
|
|
3522
|
my $modlist_file = $self->modlist_file; |
41
|
|
|
|
|
|
|
|
42
|
137
|
|
|
|
|
1015
|
debug("Writing module list for stack $stack at $modlist_file"); |
43
|
|
|
|
|
|
|
|
44
|
137
|
50
|
|
|
|
764
|
my $fh = IO::Zlib->new( $modlist_file->stringify, 'wb' ) or throw $!; |
45
|
137
|
|
|
|
|
265930
|
print {$fh} $self->modlist_data; |
|
137
|
|
|
|
|
711
|
|
46
|
137
|
50
|
|
|
|
26225
|
close $fh or throw $!; |
47
|
|
|
|
|
|
|
|
48
|
137
|
|
|
|
|
45968
|
return $self; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub modlist_data { |
54
|
137
|
|
|
137
|
0
|
426
|
my ($self) = @_; |
55
|
|
|
|
|
|
|
|
56
|
137
|
|
|
|
|
547
|
my $writer = ref $self; |
57
|
137
|
|
50
|
|
|
2824
|
my $version = $self->VERSION || 'UNKNOWN'; |
58
|
137
|
|
|
|
|
547
|
my $package = 'CPAN::Modulelist'; |
59
|
137
|
|
|
|
|
896
|
my $date = time2str(time); |
60
|
|
|
|
|
|
|
|
61
|
137
|
|
|
|
|
4849
|
return <<"END_MODLIST"; |
62
|
|
|
|
|
|
|
File: 03modlist.data |
63
|
|
|
|
|
|
|
Description: This a placeholder for CPAN.pm |
64
|
|
|
|
|
|
|
Modcount: 0 |
65
|
|
|
|
|
|
|
Written-By: $writer version $version |
66
|
|
|
|
|
|
|
Date: $date |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
package $package; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub data { {} } |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
END_MODLIST |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
__END__ |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=pod |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=encoding UTF-8 |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=for :stopwords Jeffrey Ryan Thalhammer |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 NAME |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Pinto::ModlistWriter - Generates a stub 03modlist.data.gz file |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 VERSION |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
version 0.14 |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 AUTHOR |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Jeffrey Ryan Thalhammer <jeff@stratopan.com> |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Jeffrey Ryan Thalhammer. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
110
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=cut |