Debian Codegraph @

upstream/opensuse-tumbleweed/man3/App::Cpan.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 "App::Cpan 3pm"
61 .TH App::Cpan 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 App::Cpan \- easily interact with CPAN from the command line
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 2
71 \& # with arguments and no switches, installs specified modules
72 \& cpan module_name [ module_name ... ]
73 \&
74 \& # with switches, installs modules with extra behavior
75 \& cpan [\-cfFimtTw] module_name [ module_name ... ]
76 \&
77 \& # use local::lib
78 \& cpan \-I module_name [ module_name ... ]
79 \&
80 \& # one time mirror override for faster mirrors
81 \& cpan \-p ...
82 \&
83 \& # with just the dot, install from the distribution in the
84 \& # current directory
85 \& cpan .
86 \&
87 \& # without arguments, starts CPAN.pm shell
88 \& cpan
89 \&
90 \& # without arguments, but some switches
91 \& cpan [\-ahpruvACDLOPX]
92 .Ve
93 .SH DESCRIPTION
94 .IX Header "DESCRIPTION"
95 This script provides a command interface (not a shell) to CPAN. At the
96 moment it uses CPAN.pm to do the work, but it is not a one\-shot command
97 runner for CPAN.pm.
98 .SS Options
99 .IX Subsection "Options"
100 .IP \-a 4
101 .IX Item "-a"
102 Creates a CPAN.pm autobundle with CPAN::Shell\->autobundle.
103 .IP "\-A module [ module ... ]" 4
104 .IX Item "-A module [ module ... ]"
105 Shows the primary maintainers for the specified modules.
106 .IP "\-c module" 4
107 .IX Item "-c module"
108 Runs a \`make clean\` in the specified module\*(Aqs directories.
109 .IP "\-C module [ module ... ]" 4
110 .IX Item "-C module [ module ... ]"
111 Show the \fIChanges\fR files for the specified modules
112 .IP "\-D module [ module ... ]" 4
113 .IX Item "-D module [ module ... ]"
114 Show the module details. This prints one line for each out\-of\-date module
115 (meaning, modules locally installed but have newer versions on CPAN).
116 Each line has three columns: module name, local version, and CPAN
117 version.
118 .IP \-f 4
119 .IX Item "-f"
120 Force the specified action, when it normally would have failed. Use this
121 to install a module even if its tests fail. When you use this option,
122 \&\-i is not optional for installing a module when you need to force it:
123 .Sp
124 .Vb 1
125 \& % cpan \-f \-i Module::Foo
126 .Ve
127 .IP \-F 4
128 .IX Item "-F"
129 Turn off CPAN.pm\*(Aqs attempts to lock anything. You should be careful with
130 this since you might end up with multiple scripts trying to muck in the
131 same directory. This isn\*(Aqt so much of a concern if you\*(Aqre loading a special
132 config with \f(CW\*(C`\-j\*(C'\fR, and that config sets up its own work directories.
133 .IP "\-g module [ module ... ]" 4
134 .IX Item "-g module [ module ... ]"
135 Downloads to the current directory the latest distribution of the module.
136 .IP "\-G module [ module ... ]" 4
137 .IX Item "-G module [ module ... ]"
138 UNIMPLEMENTED
139 .Sp
140 Download to the current directory the latest distribution of the
141 modules, unpack each distribution, and create a git repository for each
142 distribution.
143 .Sp
144 If you want this feature, check out Yanick Champoux\*(Aqs \f(CW\*(C`Git::CPAN::Patch\*(C'\fR
145 distribution.
146 .IP \-h 4
147 .IX Item "-h"
148 Print a help message and exit. When you specify \f(CW\*(C`\-h\*(C'\fR, it ignores all
149 of the other options and arguments.
150 .IP "\-i module [ module ... ]" 4
151 .IX Item "-i module [ module ... ]"
152 Install the specified modules. With no other switches, this switch
153 is implied.
154 .IP \-I 4
155 .IX Item "-I"
156 Load \f(CW\*(C`local::lib\*(C'\fR (think like \f(CW\*(C`\-I\*(C'\fR for loading lib paths). Too bad
157 \&\f(CW\*(C`\-l\*(C'\fR was already taken.
158 .IP "\-j Config.pm" 4
159 .IX Item "-j Config.pm"
160 Load the file that has the CPAN configuration data. This should have the
161 same format as the standard \fICPAN/Config.pm\fR file, which defines
162 \&\f(CW$CPAN::Config\fR as an anonymous hash.
163 .Sp
164 If the file does not exist, \f(CW\*(C`cpan\*(C'\fR dies.
165 .IP \-J 4
166 .IX Item "-J"
167 Dump the configuration in the same format that CPAN.pm uses. This is useful
168 for checking the configuration as well as using the dump as a starting point
169 for a new, custom configuration.
170 .IP \-l 4
171 .IX Item "-l"
172 List all installed modules with their versions
173 .IP "\-L author [ author ... ]" 4
174 .IX Item "-L author [ author ... ]"
175 List the modules by the specified authors.
176 .IP \-m 4
177 .IX Item "-m"
178 Make the specified modules.
179 .IP "\-M mirror1,mirror2,..." 4
180 .IX Item "-M mirror1,mirror2,..."
181 A comma\-separated list of mirrors to use for just this run. The \f(CW\*(C`\-P\*(C'\fR
182 option can find them for you automatically.
183 .IP \-n 4
184 .IX Item "-n"
185 Do a dry run, but don\*(Aqt actually install anything. (unimplemented)
186 .IP \-O 4
187 .IX Item "-O"
188 Show the out\-of\-date modules.
189 .IP \-p 4
190 .IX Item "-p"
191 Ping the configured mirrors and print a report
192 .IP \-P 4
193 .IX Item "-P"
194 Find the best mirrors you could be using and use them for the current
195 session.
196 .IP \-r 4
197 .IX Item "-r"
198 Recompiles dynamically loaded modules with CPAN::Shell\->recompile.
199 .IP \-s 4
200 .IX Item "-s"
201 Drop in the CPAN.pm shell. This command does this automatically if you don\*(Aqt
202 specify any arguments.
203 .IP "\-t module [ module ... ]" 4
204 .IX Item "-t module [ module ... ]"
205 Run a \`make test\` on the specified modules.
206 .IP \-T 4
207 .IX Item "-T"
208 Do not test modules. Simply install them.
209 .IP \-u 4
210 .IX Item "-u"
211 Upgrade all installed modules. Blindly doing this can really break things,
212 so keep a backup.
213 .IP \-v 4
214 .IX Item "-v"
215 Print the script version and CPAN.pm version then exit.
216 .IP \-V 4
217 .IX Item "-V"
218 Print detailed information about the cpan client.
219 .IP \-w 4
220 .IX Item "-w"
221 UNIMPLEMENTED
222 .Sp
223 Turn on cpan warnings. This checks various things, like directory permissions,
224 and tells you about problems you might have.
225 .IP "\-x module [ module ... ]" 4
226 .IX Item "-x module [ module ... ]"
227 Find close matches to the named modules that you think you might have
228 mistyped. This requires the optional installation of Text::Levenshtein or
229 Text::Levenshtein::Damerau.
230 .IP \-X 4
231 .IX Item "-X"
232 Dump all the namespaces to standard output.
233 .SS Examples
234 .IX Subsection "Examples"
235 .Vb 2
236 \& # print a help message
237 \& cpan \-h
238 \&
239 \& # print the version numbers
240 \& cpan \-v
241 \&
242 \& # create an autobundle
243 \& cpan \-a
244 \&
245 \& # recompile modules
246 \& cpan \-r
247 \&
248 \& # upgrade all installed modules
249 \& cpan \-u
250 \&
251 \& # install modules ( sole \-i is optional )
252 \& cpan \-i Netscape::Booksmarks Business::ISBN
253 \&
254 \& # force install modules ( must use \-i )
255 \& cpan \-fi CGI::Minimal URI
256 \&
257 \& # install modules but without testing them
258 \& cpan \-Ti CGI::Minimal URI
259 .Ve
260 .SS "Environment variables"
261 .IX Subsection "Environment variables"
262 There are several components in CPAN.pm that use environment variables.
263 The build tools, ExtUtils::MakeMaker and Module::Build use some,
264 while others matter to the levels above them. Some of these are specified
265 by the Perl Toolchain Gang:
266 .PP
267 Lancaster Consensus: <https://github.com/Perl\-Toolchain\-Gang/toolchain\-site/blob/master/lancaster\-consensus.md>
268 .PP
269 Oslo Consensus: <https://github.com/Perl\-Toolchain\-Gang/toolchain\-site/blob/master/oslo\-consensus.md>
270 .IP NONINTERACTIVE_TESTING 4
271 .IX Item "NONINTERACTIVE_TESTING"
272 Assume no one is paying attention and skips prompts for distributions
273 that do that correctly. \f(CWcpan(1)\fR sets this to \f(CW1\fR unless it already
274 has a value (even if that value is false).
275 .IP PERL_MM_USE_DEFAULT 4
276 .IX Item "PERL_MM_USE_DEFAULT"
277 Use the default answer for a prompted questions. \f(CWcpan(1)\fR sets this
278 to \f(CW1\fR unless it already has a value (even if that value is false).
279 .IP CPAN_OPTS 4
280 .IX Item "CPAN_OPTS"
281 As with \f(CW\*(C`PERL5OPT\*(C'\fR, a string of additional \f(CWcpan(1)\fR options to
282 add to those you specify on the command line.
283 .IP CPANSCRIPT_LOGLEVEL 4
284 .IX Item "CPANSCRIPT_LOGLEVEL"
285 The log level to use, with either the embedded, minimal logger or
286 Log::Log4perl if it is installed. Possible values are the same as
287 the \f(CW\*(C`Log::Log4perl\*(C'\fR levels: \f(CW\*(C`TRACE\*(C'\fR, \f(CW\*(C`DEBUG\*(C'\fR, \f(CW\*(C`INFO\*(C'\fR, \f(CW\*(C`WARN\*(C'\fR,
288 \&\f(CW\*(C`ERROR\*(C'\fR, and \f(CW\*(C`FATAL\*(C'\fR. The default is \f(CW\*(C`INFO\*(C'\fR.
289 .IP GIT_COMMAND 4
290 .IX Item "GIT_COMMAND"
291 The path to the \f(CW\*(C`git\*(C'\fR binary to use for the Git features. The default
292 is \f(CW\*(C`/usr/local/bin/git\*(C'\fR.
293 .SS Methods
294 .IX Subsection "Methods"
295 .IP "run( ARGS )" 4
296 .IX Item "run( ARGS )"
297 Just do it.
298 .Sp
299 The \f(CW\*(C`run\*(C'\fR method returns 0 on success and a positive number on
300 failure. See the section on EXIT CODES for details on the values.
301 .Sp
302 CPAN.pm sends all the good stuff either to STDOUT, or to a temp
303 file if \f(CW$CPAN::Be_Silent\fR is set. I have to intercept that output
304 so I can find out what happened.
305 .Sp
306 Stolen from File::Path::Expand
307 .SH "EXIT VALUES"
308 .IX Header "EXIT VALUES"
309 The script exits with zero if it thinks that everything worked, or a
310 positive number if it thinks that something failed. Note, however, that
311 in some cases it has to divine a failure by the output of things it does
312 not control. For now, the exit codes are vague:
313 .PP
314 .Vb 1
315 \& 1 An unknown error
316 \&
317 \& 2 The was an external problem
318 \&
319 \& 4 There was an internal problem with the script
320 \&
321 \& 8 A module failed to install
322 .Ve
323 .SH "TO DO"
324 .IX Header "TO DO"
325 * There is initial support for Log4perl if it is available, but I
326 haven\*(Aqt gone through everything to make the NullLogger work out
327 correctly if Log4perl is not installed.
328 .PP
329 * When I capture CPAN.pm output, I need to check for errors and
330 report them to the user.
331 .PP
332 * Warnings switch
333 .PP
334 * Check then exit
335 .SH BUGS
336 .IX Header "BUGS"
337 * none noted
338 .SH "SEE ALSO"
339 .IX Header "SEE ALSO"
340 CPAN, App::cpanminus
341 .SH "SOURCE AVAILABILITY"
342 .IX Header "SOURCE AVAILABILITY"
343 This code is in Github in the CPAN.pm repository:
344 .PP
345 .Vb 1
346 \& https://github.com/andk/cpanpm
347 .Ve
348 .PP
349 The source used to be tracked separately in another GitHub repo,
350 but the canonical source is now in the above repo.
351 .SH CREDITS
352 .IX Header "CREDITS"
353 Japheth Cleaver added the bits to allow a forced install (\f(CW\*(C`\-f\*(C'\fR).
354 .PP
355 Jim Brandt suggested and provided the initial implementation for the
356 up\-to\-date and Changes features.
357 .PP
358 Adam Kennedy pointed out that \f(CWexit()\fR causes problems on Windows
359 where this script ends up with a .bat extension
360 .PP
361 David Golden helps integrate this into the \f(CW\*(C`CPAN.pm\*(C'\fR repos.
362 .PP
363 Jim Keenan fixed up various issues with _download
364 .SH AUTHOR
365 .IX Header "AUTHOR"
366 brian d foy, \f(CW\*(C`<[email protected]>\*(C'\fR
367 .SH COPYRIGHT
368 .IX Header "COPYRIGHT"
369 Copyright (c) 2001\-2021, brian d foy, All Rights Reserved.
370 .PP
371 You may redistribute this under the same terms as Perl itself.