lcpan - Manage your local CPAN mirror
This document describes version 1.022 of lcpan (from Perl distribution App-lcpan), released on 2018-02-08.
% lcpan update
A mini CPAN mirror will be downloaded in your ~/cpan directory. This will take a while (it downloads ~3.5GB of files, as of 2016-01-21; subsequent updates will of course take shorter time.)
~/cpan
A SQLite database is also created/updated in ~/cpan/index.db which contains information about authors, modules/packages, distributions. This database is used to answer various queries.
~/cpan/index.db
You can run the above command e.g. daily to keep your mirror up-to-date.
Sometimes, you only want to add one or a few modules to the local CPAN mirror. For example, you are on a bad/expensive Internet connection and cannot afford a full mirror update. Or, you have a module that is not indexed on CPAN but want to add to your local mirror. To do that:
% lcpan inject --author SOMEONE Foo-0.01.tar.gz Bar-Baz-2.34.tar.gz
where SOMEONE is an author ID (does not need to already exist) that you choose to put the modules under.
SOMEONE
This will add the files to the local mirror as well as update the index.
% lcpanm -n Some::Module
lcpanm is a thin wrapper for cpanm, the above command is equivalent to:
lcpanm
cpanm
% cpanm --mirror ~/cpan --mirror-only -n Some::Module
Info about your local CPAN mirror:
% lcpan stats +------------------------------+----------------------+ | key | value | | last_index_time | 2015-01-15T13:09:25Z | | mirror_mtime | 2015-01-15T13:09:22Z | | num_authors | 11981 | | num_dists | 30376 | | num_modules | 151927 | | num_releases | 31877 | | num_releases_with_buildpl | 6521 | | num_releases_with_makefilepl | 28948 | | num_releases_with_metajson | 10625 | | num_releases_with_metayml | 10689 | | schema_version | 3 | +------------------------------+----------------------+
Add --verbose if you want more stats which normally are skipped because they can take a while to get (e.g. disk-space).
--verbose
List modules:
% lcpan modules ;# list all mods % lcpan mods <SOMEQUERY>... --detail ;# show matching mods only (mods is alias for 'modules') % lcpan mods Win32 ;# list mods containing 'Win32' in their name/abstract % lcpan mods Win32 API ;# list mods containing 'Win32' and 'API' in their name/abstract % lcpan mods Win32 API --or ;# list mods containing 'Win32' *or* 'API' in their name/abstract % lcpan mods 'Win32%' ;# perform SQL LIKE query (mods whose name/abstract begins with 'Win32') % lcpan mods --or --query-type exact-name Module1 Module2 --detail ;# show detail for several mods % lcpan mods --author PERLANCAR ;# mods by some author only % lcpan mods --dist libwww-perl ;# mods from certain dist only % lcpan mods --namespace Getopt ;# mods from certain namespace % lcpan mods --namespace Getopt --sort -rdeps ;# list "popular" modules first (sort by number of reverse deps)
List namespaces:
% lcpan namespaces ;# list all namespaces % lcpan namespaces <SOMEQUERY>... --detail ;# show matching namespaces only % lcpan namespaces --or --exact-match Win32 MacOSX --detail ;# show detail for several namespaces % lcpan namespaces -l1 --detail --sort -num_modules ;# list top-level namespaces sorted by number of packages
List distributions:
% lcpan dists ;# list all dists % lcpan dists --latest ;# list all latest dists % lcpan dists <SOMEQUERY>... --detail ;# show matching dists only % lcpan dists --or --exact-match Dist1 Dist2 --detail ;# show detail for several dists % lcpan dists --author PERLANCAR ;# dists from certain author only
List authors:
% lcpan authors ;# list all authors % lcpan authors <SOMEQUERY>... --detail ;# list matching authors only % lcpan authors --or --exact-match PERLANCAR KENTNL --detail ;# show detail for several authors
List releases (tarballs):
% lcpan releases ;# list all releases % lcpan rels <SOMEQUERY>... --detail ;# rels is alias for 'releases' % lcpan rels --or --exact-match Foo-1.23.tar.gz Bar-2.34.tar.gz --detail ;# show detail for several rels % lcpan rels --author PERLANCAR ;# rels from certain authors only
List contents (files inside release archives):
% lcpan contents ;# WARNING: LOTS of output % lcpan contents <SOMEQUERY> ... --detail ;# search, show detail % lcpan contents --dist File-Path ;# list content of a single dist only
List scripts:
% lcpan scripts ;# WARNING: lots of output % lcpan scripts <SOMEQUERY> ... --detail ;# search, show detail % lcpan scripts --dist App-PMUtils ;# list scripts of a single dist only
Show dependencies and reverse dependencies:
% lcpan deps Text::ANSITable ;# which modules does Text::ANSITable depend on? % lcpan deps Text::ANSITable -R ;# recursive % lcpan deps Text::ANSITable -R --flatten ;# recursive & flatten result % lcpan deps Task::BeLike::CSSON --phase build % lcpan deps Text::ANSITable --phase ALL --rel ALL % lcpan rdeps Text::ANSITable ;# which dists depend on Text::ANSITable?
Show mentions (references to modules/scripts from POD files within releases):
% lcpan mentions --mentioned-module Path::Tiny ;# who mentions Path::Tiny module? % lcpan mentions --mentioned-script mpath ;# who mentions mpath script?
Some other utilities:
% lcpan mod2dist Text::ANSITable::ColorTheme::Default ;# -> Text-ANSITable % lcpan mod2rel Text::ANSITable::ColorTheme::Default ;# -> Text-ANSITable-0.39.tar.gz % lcpan mod2rel Text::ANSITable --full-path ;# -> /cpan/authors/id/P/PE/PERLANCAR/Text-ANSITable-0.39.tar.gz % lcpan dist2rel Text-ANSITable ;# -> Text-ANSITable-0.39.tar.gz % lcpan dist2rel Text-ANSITable --full-path ;# -> /cpan/authors/id/P/PE/PERLANCAR/Text-ANSITable-0.39.tar.gz % lcpan dist-mods Text-ANSITable ;# list modules in a distribution Text::ANSITable Text::ANSITable::BorderStyle::Default Text::ANSITable::ColorTheme::Default Text::ANSITable::StyleSet::AltRow % lcpan dist-scripts Text-ANSITable ;# list scripts in a distribution % lcpan author-mods PERLANCAR ;# list an author's modules % lcpan author-dists PERLANCAR ;# list an author's dists % lcpan author-rels PERLANCAR ;# list an author's releases # who are authors with the most number of releases? % lcpan authors-by-rel-count # who are authors with the most number of distributions? % lcpan authors-by-dist-count # who are authors with the most number of registered modules/packages? % lcpan authors-by-mod-count # show all other authors' distributions using one of your modules % lcpan author-rdeps PERLANCAR --user-author-isnt PERLANCAR # show your old releases (which you should probably delete from CPAN?) % lcpan releases --author PERLANCAR --nolatest # what are modules that are used the most by other distributions? % lcpan mods-by-rdep-count # show POD documentation for module/.pod/script (works for uninstalled # modules/scripts since this works by extracting the POD from release tarballs # in the mirror) % lcpan doc Rinci ;# looks for .pod, .pm, or script % lcpan doc Rinci.pod ;# specifically looks for .pod % lcpan doc Rinci.pm ;# specifically looks for .pm % lcpan doc plackup ;# script % lcpan doc plackup -r ;# dump the raw POD instead of rendering it
More subcommands are available. lcpan is plugin-based, see/install App::lcpan::Cmd::* modules for more subcommands.
App::lcpan::Cmd::*
This application is a convenient bundling of CPAN::Mini and an indexer so in addition to creating your local CPAN mirror and installing modules from it, you can also query various things about your local CPAN mirror quickly from the command-line (as well as programmatically). Powerful and more convenient querying is the main reason lcpan is created.
CPAN::Mini
lcpan
TODO
% lcpan author-mods PERLANCAR | cpanm -n
or (if you want to install from local CPAN mirror):
% lcpan author-mods PERLANCAR | lcpanm -n
or (specify release files directly):
% lcpan author-rels --latest PERLANCAR | cpanm -n
% cpan-outdated --mirror file:$HOME/cpan | lcpanm -n
% lcpan author-mods PERLANCAR | wc -l % lcpan author-dists PERLANCAR | wc -l % lcpan author-rels PERLANCAR | wc -l
For more complex queries, you can always access the SQLite database directly. See App::lcpan for the database schema.
List dependencies for all of the dists of an author.
List all dependencies of dists of an author, sorted by number of dependent dists.
List distributions of an author.
List modules of an author.
Find distributions that use one of author's modules.
List releases of an author.
List scripts of an author.
List authors.
List authors ranked by number of dists.
List authors ranked by total size of their indexed releases.
List authors ranked by number of modules.
List authors ranked by number of module mentions.
This shows the list of most mentioned authors, that is, authors whose modules are linked/referred to the most in PODs.
By default, each source module/script that mentions a module from author is counted as one mention (--count-per content). Use --count-per dist to only count mentions by modules/scripts from the same dist as one mention (so an author only gets a maximum of 1 vote per dist). Use --count-per author to only count mentions by modules/scripts from the same author as one mention (so an author only gets a maximum of 1 vote per mentioning author).
--count-per content
--count-per dist
--count-per author
By default, only mentions from other authors are included. Use --include-self-mentions to also include mentions from the same author.
--include-self-mentions
List authors ranked by number of distributions using one of his/her modules.
List authors ranked by number of releases.
List authors ranked by number of scripts.
Show Changes of distribution/module.
This command will find a file named Changes/CHANGES/ChangeLog or other similar name in the top-level directory inside the release tarballs and show it.
List contents inside releases.
This subcommand lists files inside release archives.
Copy a module's latest release file to current directory.
Copy a release file to current directory.
Copy a script's latest release file to current directory.
Delete a release record in the database.
Will delete records associated with a release in the database (including in the file table, module, dist, dep, and so on). If --delete-file option is specified, will also remove the file from the local mirror.
file
module
dist
dep
--delete-file
But currently will not remove/update the modules/02packages.details.txt.gz index.
modules/02packages.details.txt.gz
List dependencies.
By default only runtime requires are displayed. To see prereqs for other phases (e.g. configure, or build, or ALL) or for other relationships (e.g. recommends, or ALL), use the --phase and --rel options.
--phase
--rel
Note that dependencies information are taken from META.json or META.yml files. Not all releases (especially older ones) contain them. lcpan (like MetaCPAN) does not extract information from Makefile.PL or Build.PL because that requires running (untrusted) code.
META.json
META.yml
Makefile.PL
Build.PL
Also, some releases specify dynamic config, so there might actually be more dependencies.
List dependencies, sorted by number of dependents.
This subcommand is like deps, except that this subcommand does not support recursing and it sorts the result by number of dependent dists. For example, Suppose that dist Foo depends on Mod1 and Mod2, Bar depends on Mod2 and Mod3, and Baz depends on Mod2 and Mod3, then lcpan deps-by-dependent-count Foo Bar Baz will return Mod2 (3 dependents), Mod3 (2 dependents), Mod1 (1 dependent).
deps
Foo
Mod1
Mod2
Bar
Mod3
Baz
lcpan deps-by-dependent-count Foo Bar Baz
List contents inside a distribution.
This subcommand lists files inside a distribution.
% lcpan dist-contents Foo-Bar
is basically equivalent to:
% lcpan contents --dist Foo-Bar
Get distribution metadata.
List modules in a distribution.
List scripts in a distribution.
Get author of distribution(s).
Get (latest) release name of a distribution.
List distributions.
List "heavy" distributions (ranked by number of dependencies).
Show POD documentation of module/.pod/script.
This command extracts module (.pm)/.pod/script from release tarballs and render its POD documentation. Since the documentation is retrieved from the release tarballs in the mirror, the module/.pod/script needs not be installed.
Note that currently this command has trouble finding documentation for core modules because those are contained in perl release tarballs instead of release tarballs of modules, and lcpan is currently not designed to work with those.
Extract a module's latest release file to current directory.
Extract a release to current directory.
Extract a script's latest release file to current directory.
Inject one or more tarballs to the mirror.
List mentions.
This subcommand lists mentions (references to modules/scripts in POD files inside releases).
Only mentions to modules/scripts in another release are indexed (i.e. mentions to modules/scripts in the same dist/release are not indexed). Only mentions to known scripts are indexed, but mentions to unknown modules are also indexed.
List POD mentions by module(s).
This subcommand is a shortcut for:
% lcpan mentions --mentioner-module MOD
List POD mentions by script(s).
% lcpan mentions --mentioner-script SCRIPT
List PODs which mention all specified module(s).
List POD mentions for module(s).
% lcpan mentions --type known-module --mentioned-module MOD
List POD mentions for script(s).
% lcpan mentions --type script --mentioned-script SCRIPT
List contents inside a module's distribution.
This subcommand lists files inside a module's distribution.
% lcpan mod-contents Foo::Bar
% lcpan contents --dist C<lcpan mod2dist Foo::Bar>
Get author of module(s).
Get distribution name of module(s).
Get (latest) release name of a module.
Alias for 'modules'.
List modules ranked by number of mentions.
This shows the list of most mentioned modules, that is, modules who are linked/referred to the most in PODs.
Unknown modules (modules not indexed) are not included. Note that mentions can refer to unknown modules.
By default, each source module/script that mentions a module is counted as one mention (--count-per content). Use --count-per dist to only count mentions by modules/scripts from the same dist as one mention (so a module only gets a maximum of 1 vote per dist). Use --count-per author to only count mentions by modules/scripts from the same author as one mention (so a module only gets a maximum of 1 vote per mentioning author).
List modules ranked by number of reverse dependencies.
Given a module, list all modules in the same distribution.
List modules/packages.
List namespaces.
List reverse dependencies.
List other modules related to module(s).
This subcommand lists other modules that might be related to the module(s) you specify. This is done by listing modules that tend be mentioned together in POD documentation.
The scoring/ranking still needs to be tuned.
List releases/tarballs.
The status field is the processing status of the file/release by lcpan. ok means file has been extracted and the meta files parsed, nofile means file is not found in mirror (possibly because the mirroring process excludes the file e.g. due to file size too large), nometa means file does not contain META.{yml,json}, unsupported means file archive format is not supported (e.g. rar), err means some other error in processing file.
ok
nofile
nometa
unsupported
err
Alias for 'releases'.
Reset (empty) the database index.
Get author name of script(s).
Get distribution(s) of script(s).
Get module(s) of script(s).
This returns a module name from the same dist as the script, so one can do something like this (install dist which contains a specified script from CPAN):
% cpanm -n C<lcpan script2mod pmdir>
Get release(s) of script(s).
List scripts.
This subcommand lists scripts. Scripts are identified heuristically from contents of release archives matching this regex:
# container dir, script dir, script name \A (\./)? ([^/]+)/? (s?bin|scripts?)/ ([^/]+) \z
A few exception are excluded, e.g. if script name begins with a dot (e.g. bin/.exists which is usually a marker only).
bin/.exists
Scripts are currently indexed by its release file and its name, so if a single release contains both bin/foo and script/foo, only one of those will be indexed. Normally a proper release shouldn't be like that though.
bin/foo
script/foo
List scripts ranked by number of mentions.
This shows the list of most mentioned scripts, that is, scripts who are linked/referred to the most in PODs.
By default, each source module/script that mentions a script is counted as one mention (--count-per content). Use --count-per dist to only count mentions by modules/scripts from the same dist as one mention (so a script only gets a maximum of 1 vote per dist). Use --count-per author to only count mentions by modules/scripts from the same author as one mention (so a script only gets a maximum of 1 vote per mentioning author).
Given a script, list all scripts in the same distribution.
Show source of module/.pod/script.
This command is a shortcut for:
% lcpan doc --raw MODULE_OR_POD_OR_SCRIPT
Statistics of your local CPAN mirror.
Return last index time of mirror.
This is mostly to support App::lcpan::Call. See also stats subcommand which gives a more complete statistics, but can be much slower.
stats
List subroutine names ranked by number of occurrences.
List subroutines.
This subcommand lists subroutines/methods/static methods.
Create/update local CPAN mirror.
This subcommand first create/update the mirror files by downloading from a remote CPAN mirror, then update the index.
* marks required options.
*
Set path to configuration file.
Can be specified multiple times.
Set configuration profile to use.
Location of your local CPAN mirror, e.g. /path/to/cpan.
Defaults to ~/cpan.
Shortcut for --log-level=debug.
Choose output format, e.g. json, text.
Default value:
undef
Display help message and exit.
Filename of index.
"index.db"
Set output format to json.
Set log level.
Do not use any configuration file.
Do not read environment for default options.
When outputing as JSON, add result envelope.
By default, when outputing as JSON, the full enveloped result is returned, e.g.:
[200,"OK",[1,2,3],{"func.extra"=>4}]
The reason is so you can get the status (1st element), status message (2nd element) as well as result metadata/extra result (4th element) instead of just the result (3rd element). However, sometimes you want just the result, e.g. when you want to pipe the result for more post-processing. In this case you can use `--naked-res` so you just get:
[1,2,3]
Shortcut for --log-level=error.
List available subcommands.
Shortcut for --log-level=trace.
Shortcut for --log-level=info.
Display program's version and exit.
Equivalent to --phase ALL --rel ALL.
See --phase.
Instead of showing tree-like information, flatten it.
When recursing, the default is to show the final result in a tree-like table, i.e. indented according to levels, e.g.:
% lcpan deps -R MyModule | module | author | version | |-------------------|---------|---------| | Foo | AUTHOR1 | 0.01 | | Bar | AUTHOR2 | 0.23 | | Baz | AUTHOR3 | 1.15 | | Qux | AUTHOR2 | 0 |
To be brief, if `Qux` happens to also depends on `Bar`, it will not be shown in the result. Thus we don't know the actual `Bar` version that is needed by the dependency tree of `MyModule`. For example, if `Qux` happens to depends on `Bar` version 0.45 then `MyModule` indirectly requires `Bar` 0.45.
To list all the direct and indirect dependencies on a single flat list, with versions already resolved to the largest version required, use the `flatten` option:
% lcpan deps -R --flatten MyModule | module | author | version | |-------------------|---------|---------| | Foo | AUTHOR1 | 0.01 | | Bar | AUTHOR2 | 0.45 | | Baz | AUTHOR3 | 1.15 | | Qux | AUTHOR2 | 0 |
Note that `Bar`'s required version is already 0.45 in the above example.
Recurse for a number of levels (-1 means unlimited).
1
Do not list depended modules published by specified author(s).
Only list depended modules published by specified author(s).
Do not list depended modules published by specified author(s) (JSON-encoded).
See --module-author-isnt.
--module-author-isnt
Only list depended modules published by specified author(s) (JSON-encoded).
See --module-author.
--module-author
Exclude core modules.
Exclude non-core modules.
Set base Perl version for determining core modules.
"v5.26.0"
"runtime"
"requires"
Check each dependency as XS/PP.
Recurse (alias for `--level -1`).
See --level.
--level
See --author-isnt.
--author-isnt
See --author.
--author
"ALL"
See --user-author-isnt.
--user-author-isnt
See --user-author.
--user-author
See --sort.
--sort
["name"]
When there are more than one query, perform OR instead of AND logic.
Search query (JSON-encoded).
See --query.
--query
"any"
Valid values:
["any","cpanid","exact-cpanid","fullname","email","exact-email"]
Search query.
Shortcut --query-type cpanid.
See --query-type.
--query-type
Shortcut --query-type exact-cpanid.
"content"
["content","dist","author"]
Module or dist or script name.
Filter by author.
Filter by file ID.
["any","path","exact-path","package","exact-package"]
Whether to overwrite existing file.
Whether to delete the release file from the filesystem too.
See --module.
--module
See --dist.
--dist
Only list dists having multiple releases indexed.
["any","name","exact-name","abstract"]
Sort the result (JSON-encoded).
Sort the result.
["dist"]
Shortcut --query-type name.
Shortcut --query-type exact-name.
"man"
["raw","html","man"]
Show HTML documentation in browser instead of rendering as man.
See --format-arg.
--format-arg
Read as manpage (the default).
Module or script name.
If the name matches both module name and script name, the module will be chosen. To choose the script, use `--script` (`-s`).
Dump raw POD instead of rendering it.
Look for script first.
Same as --raw.
See --file.
--file
Filter by author(s) of module/script being mentioned.
Filter by author(s) of module/script being mentioned (JSON-encoded).
See --mentioned-author.
--mentioned-author
Filter by module name(s) being mentioned.
Filter by module name(s) being mentioned (JSON-encoded).
See --mentioned-module.
--mentioned-module
Filter by script name(s) being mentioned.
Filter by script name(s) being mentioned (JSON-encoded).
See --mentioned-script.
--mentioned-script
Filter by author(s) of POD that does the mentioning.
See --mentioner-author-isnt.
--mentioner-author-isnt
Filter by author(s) of POD that does the mentioning (JSON-encoded).
See --mentioner-author.
--mentioner-author
Filter by module(s) that do the mentioning.
Filter by module(s) that do the mentioning (JSON-encoded).
See --mentioner-module.
--mentioner-module
Filter by script(s) that do the mentioning.
Filter by script(s) that do the mentioning (JSON-encoded).
See --mentioner-script.
--mentioner-script
Filter by type of things being mentioned.
["any","script","module","unknown-module","known-module"]
See --script.
--script
Filter by distribution.
Select modules belonging to certain namespace(s).
Select modules belonging to certain namespace(s) (JSON-encoded).
See --namespace.
--namespace
["module"]
["any","name","exact-name"]
"name"
["name","-name","num_modules","-num_modules"]
Filter out certain author.
This can be used to filter out certain author(s). For example if you want to know whether a module is being used by another CPAN author instead of just herself.
Filter certain author.
This can be used to select certain author(s).
Filter out certain author (JSON-encoded).
Filter certain author (JSON-encoded).
Recurse (alias for `--level 10`).
Maximum number of modules to return.
20
Skip modules from the same distribution.
["-score","-num_mentions"]
Return score-related fields.
Filter by author(s) of module.
Filter by author(s) of module (JSON-encoded).
Filter by package name(s).
Filter by package name(s) (JSON-encoded).
See --package.
--package
["sub"]
Exclude files from certain author(s) (JSON-encoded).
See --exclude-author.
--exclude-author
Exclude files from certain author.
Update the index even though there is no change in files.
Only include files from certain author(s) (JSON-encoded).
See --include-author.
--include-author
Only include files from certain author.
If set, skip downloading files larger than this.
Since sub indexing is still experimental, it is not enabled by default. To enable it, pass the `--no-skip-sub-indexing` option.
Skip updating the files.
Skip updating the index.
Select CPAN mirror to download from.
Skip a file from being indexed.
Skip one or more files from being indexed (JSON-encoded).
See --skip-index-file.
--skip-index-file
Alias for --skip-index-file.
This script has shell tab completion capability with support for several shells.
To activate bash completion for this script, put:
complete -C lcpan lcpan
in your bash startup (e.g. ~/.bashrc). Your next shell session will then recognize tab completion for the command. Or, you can also directly execute the line above in your shell to activate immediately.
It is recommended, however, that you install modules using cpanm-shcompgen which can activate shell completion for scripts immediately.
To activate tcsh completion for this script, put:
complete lcpan 'p/*/`lcpan`/'
in your tcsh startup (e.g. ~/.tcshrc). Your next shell session will then recognize tab completion for the command. Or, you can also directly execute the line above in your shell to activate immediately.
It is also recommended to install shcompgen (see above).
For fish and zsh, install shcompgen as described above.
By default CPAN mirror is put in ~/cpan. To customize this, use the --cpan option, e.g.:
--cpan
% lcpan update --cpan /path/to/my/cpan
You can also create a configuration ~/lcpan.conf so you don't have to specify the --cpan option everytime:
~/lcpan.conf
cpan=/path/to/my/cpan
In $cpan/index.db.
$cpan/index.db
You can try using Log::ger::DBI::Query, e.g.:
% PERL5OPT=-MLog::ger::DBI::Query TRACE=1 lcpan ...
Run lcpan reset (or delete index.db) and run lcpan update --noupdate-files again.
lcpan reset
index.db
lcpan update --noupdate-files
Could happen when there is a corrupt archive or an archive that is too big. To see which file is the culprit, try running lcpan update --noupdate-files with --verbose (or even --debug or --trace). Then, you can skip the file by using -F or adding this entry to your lcpan.conf:
--debug
--trace
-F
lcpan.conf
[update] skip_index_files=The-Culprit-1.23.tar.gz
Add more of such lines if you want to skip more files.
Run lcpan update --noupdate-index.
lcpan update --noupdate-index
Use lcpan stats.
lcpan stats
This script can read configuration files. Configuration files are in the format of IOD, which is basically INI with some extra features.
By default, these names are searched for configuration filenames (can be changed using --config-path): ~/.config/lcpan.conf, ~/lcpan.conf, or /etc/lcpan.conf.
--config-path
All found files will be read and merged.
To disable searching for configuration files, pass --no-config.
--no-config
To put configuration for a certain subcommand only, use a section name like [subcommand=NAME] or [SOMESECTION subcommand=NAME].
[subcommand=NAME]
[SOMESECTION subcommand=NAME]
You can put multiple profiles in a single file by using section names like [profile=SOMENAME] or [SOMESECTION profile=SOMENAME] or [subcommand=SUBCOMMAND_NAME profile=SOMENAME] or [SOMESECTION subcommand=SUBCOMMAND_NAME profile=SOMENAME]. Those sections will only be read if you specify the matching --config-profile SOMENAME.
[profile=SOMENAME]
[SOMESECTION profile=SOMENAME]
[subcommand=SUBCOMMAND_NAME profile=SOMENAME]
[SOMESECTION subcommand=SUBCOMMAND_NAME profile=SOMENAME]
--config-profile SOMENAME
You can also put configuration for multiple programs inside a single file, and use filter program=NAME in section names, e.g. [program=NAME ...] or [SOMESECTION program=NAME]. The section will then only be used when the reading program matches.
program=NAME
[program=NAME ...]
[SOMESECTION program=NAME]
Finally, you can filter a section by environment variable using the filter env=CONDITION in section names. For example if you only want a section to be read if a certain environment variable is true: [env=SOMEVAR ...] or [SOMESECTION env=SOMEVAR ...]. If you only want a section to be read when the value of an environment variable has value equals something: [env=HOSTNAME=blink ...] or [SOMESECTION env=HOSTNAME=blink ...]. If you only want a section to be read when the value of an environment variable does not equal something: [env=HOSTNAME!=blink ...] or [SOMESECTION env=HOSTNAME!=blink ...]. If you only want a section to be read when an environment variable contains something: [env=HOSTNAME*=server ...] or [SOMESECTION env=HOSTNAME*=server ...]. Note that currently due to simplistic parsing, there must not be any whitespace in the value being compared because it marks the beginning of a new section filter or section name.
env=CONDITION
[env=SOMEVAR ...]
[SOMESECTION env=SOMEVAR ...]
[env=HOSTNAME=blink ...]
[SOMESECTION env=HOSTNAME=blink ...]
[env=HOSTNAME!=blink ...]
[SOMESECTION env=HOSTNAME!=blink ...]
[env=HOSTNAME*=server ...]
[SOMESECTION env=HOSTNAME*=server ...]
List of available configuration parameters:
cpan (see --cpan) format (see --format) index_name (see --index-name) log_level (see --log-level) naked_res (see --naked-res)
author (see --author) flatten (see --flatten) include_core (see --no-include-core) include_noncore (see --no-include-noncore) level (see --level) module_authors (see --module-author) module_authors_arent (see --module-author-isnt) perl_version (see --perl-version) phase (see --phase) rel (see --rel) with_xs_or_pp (see --with-xs-or-pp)
author (see --author) authors (see --author) authors_arent (see --author-isnt) include_core (see --no-include-core) include_noncore (see --no-include-noncore) module_authors (see --module-author) module_authors_arent (see --module-author-isnt) perl_version (see --perl-version) phase (see --phase) rel (see --rel)
author (see --author) detail (see --detail) latest (see --latest)
author (see --author) detail (see --detail)
author (see --author) phase (see --phase) rel (see --rel) user_authors (see --user-author) user_authors_arent (see --user-author-isnt)
author (see --author) detail (see --detail) full_path (see --full-path) latest (see --latest) sort (see --sort)
detail (see --detail) or (see --or) query (see --query) query_type (see --query-type)
count_per (see --count-per) include_self_mentions (see --include-self-mentions)
exclude_same_author (see --exclude-same-author) phase (see --phase) rel (see --rel)
module_or_dist_or_script (see --module-or-dist-or-script)
author (see --author) detail (see --detail) dist (see --dist) or (see --or) package (see --package) query (see --query) query_type (see --query-type)
module (see --module) overwrite (see --overwrite)
overwrite (see --overwrite) release (see --release)
all (see --all) overwrite (see --overwrite) script (see --script)
delete_file (see --delete-file) release (see --release)
flatten (see --flatten) include_core (see --no-include-core) include_noncore (see --no-include-noncore) level (see --level) modules (see --module) perl_version (see --perl-version) phase (see --phase) rel (see --rel) with_xs_or_pp (see --with-xs-or-pp)
authors (see --author) authors_arent (see --author-isnt) include_core (see --no-include-core) include_noncore (see --no-include-noncore) modules (see --module) perl_version (see --perl-version) phase (see --phase) rel (see --rel)
author (see --author) detail (see --detail) dist (see --dist) or (see --or) package (see --package)
dist (see --dist)
detail (see --detail) dist (see --dist)
dists (see --dist)
dist (see --dist) full_path (see --full-path)
author (see --author) detail (see --detail) has_buildpl (see --has-buildpl) has_makefilepl (see --has-makefilepl) has_metajson (see --has-metajson) has_metayml (see --has-metayml) has_multiple_rels (see --has-multiple-rels) latest (see --latest) or (see --or) query (see --query) query_type (see --query-type) rel_mtime_newer_than (see --rel-mtime-newer-than) sort (see --sort)
author (see --author) phase (see --phase) rel (see --rel)
format (see --format-arg) name (see --name) script (see --script)
module (see --module)
release (see --release)
all (see --all) script (see --script)
author (see --author) files (see --file)
mentioned_authors (see --mentioned-author) mentioned_modules (see --mentioned-module) mentioned_scripts (see --mentioned-script) mentioner_authors (see --mentioner-author) mentioner_authors_arent (see --mentioner-author-isnt) mentioner_modules (see --mentioner-module) mentioner_scripts (see --mentioner-script) type (see --type)
mentioned_authors (see --mentioned-author) mentioned_modules (see --mentioned-module) mentioned_scripts (see --mentioned-script) modules (see --module) type (see --type)
mentioned_authors (see --mentioned-author) mentioned_modules (see --mentioned-module) mentioned_scripts (see --mentioned-script) scripts (see --script)
mentioned_authors (see --mentioned-author) mentioner_authors (see --mentioner-author) mentioner_authors_arent (see --mentioner-author-isnt) mentioner_modules (see --mentioner-module) mentioner_scripts (see --mentioner-script) modules (see --module)
mentioned_authors (see --mentioned-author) mentioner_authors (see --mentioner-author) mentioner_authors_arent (see --mentioner-author-isnt) mentioner_modules (see --mentioner-module) mentioner_scripts (see --mentioner-script) scripts (see --script)
author (see --author) detail (see --detail) module (see --module) or (see --or) package (see --package)
modules (see --module)
full_path (see --full-path) module (see --module)
author (see --author) detail (see --detail) dist (see --dist) include_core (see --no-include-core) include_noncore (see --no-include-noncore) latest (see --latest) namespaces (see --namespace) or (see --or) perl_version (see --perl-version) query (see --query) query_type (see --query-type) sort (see --sort)
detail (see --detail) latest (see --latest) modules (see --module)
detail (see --detail) from_level (see --from-level) level (see --level) or (see --or) query (see --query) query_type (see --query-type) sort (see --sort) to_level (see --to-level)
authors (see --author) authors_arent (see --author-isnt) level (see --level) modules (see --module) phase (see --phase) rel (see --rel)
limit (see --limit) modules (see --module) skip_same_dist (see --skip-same-dist) sort (see --sort) with_scores (see --with-scores)
author (see --author) detail (see --detail) full_path (see --full-path) has_buildpl (see --has-buildpl) has_makefilepl (see --has-makefilepl) has_metajson (see --has-metajson) has_metayml (see --has-metayml) latest (see --latest) no_path (see --no-path) or (see --or) query (see --query) query_type (see --query-type) sort (see --sort)
all (see --all) scripts (see --script)
all (see --all) full_path (see --full-path) scripts (see --script)
author (see --author) detail (see --detail) dist (see --dist) or (see --or) query (see --query) query_type (see --query-type)
detail (see --detail) latest (see --latest) scripts (see --script)
name (see --name) script (see --script)
authors (see --author) detail (see --detail) or (see --or) packages (see --package) query (see --query) query_type (see --query-type) sort (see --sort)
exclude_author (see --exclude-author) force_update_index (see --force-update-index) include_author (see --include-author) max_file_size (see --max-file-size) remote_url (see --remote-url) skip_file_indexing_pass_1 (see --skip-file-indexing-pass-1) skip_file_indexing_pass_2 (see --skip-file-indexing-pass-2) skip_file_indexing_pass_3 (see --skip-file-indexing-pass-3) skip_index_files (see --skip-index-file) skip_sub_indexing (see --no-skip-sub-indexing) update_files (see --no-update-files) update_index (see --no-update-index)
Specify additional command-line options.
~/.config/lcpan.conf
/etc/lcpan.conf
Please visit the project's homepage at https://metacpan.org/release/App-lcpan.
Source repository is at https://github.com/perlancar/perl-App-lcpan.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-lcpan
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
setop
cpan-outdated
perlancar <perlancar@cpan.org>
This software is copyright (c) 2018, 2017, 2016, 2015 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::lcpan, copy and paste the appropriate command in to your terminal.
cpanm App::lcpan
CPAN shell
perl -MCPAN -e shell install App::lcpan
For more information on module installation, please visit the detailed CPAN module installation guide.