Debian Codegraph @

upstream/opensuse-tumbleweed/man3/CPAN::Meta::Prereqs.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "CPAN::Meta::Prereqs 3pm"
61 .TH CPAN::Meta::Prereqs 3pm 2026-03-09 "perl v5.42.1" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 CPAN::Meta::Prereqs \- a set of distribution prerequisites by phase and type
68 .SH VERSION
69 .IX Header "VERSION"
70 version 2.150010
71 .SH DESCRIPTION
72 .IX Header "DESCRIPTION"
73 A CPAN::Meta::Prereqs object represents the prerequisites for a CPAN
74 distribution or one of its optional features. Each set of prereqs is
75 organized by phase and type, as described in CPAN::Meta::Prereqs.
76 .SH METHODS
77 .IX Header "METHODS"
78 .SS new
79 .IX Subsection "new"
80 .Vb 1
81 \& my $prereq = CPAN::Meta::Prereqs\->new( \e%prereq_spec );
82 .Ve
83 .PP
84 This method returns a new set of Prereqs. The input should look like the
85 contents of the \f(CW\*(C`prereqs\*(C'\fR field described in CPAN::Meta::Spec, meaning
86 something more or less like this:
87 .PP
88 .Vb 10
89 \& my $prereq = CPAN::Meta::Prereqs\->new({
90 \& runtime => {
91 \& requires => {
92 \& \*(AqSome::Module\*(Aq => \*(Aq1.234\*(Aq,
93 \& ...,
94 \& },
95 \& ...,
96 \& },
97 \& ...,
98 \& });
99 .Ve
100 .PP
101 You can also construct an empty set of prereqs with:
102 .PP
103 .Vb 1
104 \& my $prereqs = CPAN::Meta::Prereqs\->new;
105 .Ve
106 .PP
107 This empty set of prereqs is useful for accumulating new prereqs before finally
108 dumping the whole set into a structure or string.
109 .SS requirements_for
110 .IX Subsection "requirements_for"
111 .Vb 1
112 \& my $requirements = $prereqs\->requirements_for( $phase, $type );
113 .Ve
114 .PP
115 This method returns a CPAN::Meta::Requirements object for the given
116 phase/type combination. If no prerequisites are registered for that
117 combination, a new CPAN::Meta::Requirements object will be returned, and it may
118 be added to as needed.
119 .PP
120 If \f(CW$phase\fR or \f(CW$type\fR are undefined or otherwise invalid, an exception will
121 be raised.
122 .SS phases
123 .IX Subsection "phases"
124 .Vb 1
125 \& my @phases = $prereqs\->phases;
126 .Ve
127 .PP
128 This method returns the list of all phases currently populated in the prereqs
129 object, suitable for iterating.
130 .SS types_in
131 .IX Subsection "types_in"
132 .Vb 1
133 \& my @runtime_types = $prereqs\->types_in(\*(Aqruntime\*(Aq);
134 .Ve
135 .PP
136 This method returns the list of all types currently populated in the prereqs
137 object for the provided phase, suitable for iterating.
138 .SS with_merged_prereqs
139 .IX Subsection "with_merged_prereqs"
140 .Vb 1
141 \& my $new_prereqs = $prereqs\->with_merged_prereqs( $other_prereqs );
142 \&
143 \& my $new_prereqs = $prereqs\->with_merged_prereqs( \e@other_prereqs );
144 .Ve
145 .PP
146 This method returns a new CPAN::Meta::Prereqs objects in which all the
147 other prerequisites given are merged into the current set. This is primarily
148 provided for combining a distribution\*(Aqs core prereqs with the prereqs of one of
149 its optional features.
150 .PP
151 The new prereqs object has no ties to the originals, and altering it further
152 will not alter them.
153 .SS merged_requirements
154 .IX Subsection "merged_requirements"
155 .Vb 3
156 \& my $new_reqs = $prereqs\->merged_requirements( \e@phases, \e@types );
157 \& my $new_reqs = $prereqs\->merged_requirements( \e@phases );
158 \& my $new_reqs = $prereqs\->merged_requirements();
159 .Ve
160 .PP
161 This method joins together all requirements across a number of phases
162 and types into a new CPAN::Meta::Requirements object. If arguments
163 are omitted, it defaults to "runtime", "build" and "test" for phases
164 and "requires" and "recommends" for types.
165 .SS as_string_hash
166 .IX Subsection "as_string_hash"
167 This method returns a hashref containing structures suitable for dumping into a
168 distmeta data structure. It is made up of hashes and strings, only; there will
169 be no Prereqs, CPAN::Meta::Requirements, or \f(CW\*(C`version\*(C'\fR objects inside it.
170 .SS is_finalized
171 .IX Subsection "is_finalized"
172 This method returns true if the set of prereqs has been marked "finalized," and
173 cannot be altered.
174 .SS finalize
175 .IX Subsection "finalize"
176 Calling \f(CW\*(C`finalize\*(C'\fR on a Prereqs object will close it for further modification.
177 Attempting to make any changes that would actually alter the prereqs will
178 result in an exception being thrown.
179 .SS clone
180 .IX Subsection "clone"
181 .Vb 1
182 \& my $cloned_prereqs = $prereqs\->clone;
183 .Ve
184 .PP
185 This method returns a Prereqs object that is identical to the original object,
186 but can be altered without affecting the original object. Finalization does
187 not survive cloning, meaning that you may clone a finalized set of prereqs and
188 then modify the clone.
189 .SH BUGS
190 .IX Header "BUGS"
191 Please report any bugs or feature using the CPAN Request Tracker.
192 Bugs can be submitted through the web interface at
193 <http://rt.cpan.org/Dist/Display.html?Queue=CPAN\-Meta>
194 .PP
195 When submitting a bug or request, please include a test\-file or a patch to an
196 existing test\-file that illustrates the bug or desired feature.
197 .SH AUTHORS
198 .IX Header "AUTHORS"
199 .IP \(bu 4
200 David Golden <[email protected]>
201 .IP \(bu 4
202 Ricardo Signes <[email protected]>
203 .IP \(bu 4
204 Adam Kennedy <[email protected]>
205 .SH "COPYRIGHT AND LICENSE"
206 .IX Header "COPYRIGHT AND LICENSE"
207 This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.
208 .PP
209 This is free software; you can redistribute it and/or modify it under
210 the same terms as the Perl 5 programming language system itself.