Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cpanplus::internals::fetch(3) [centos man page]

CPANPLUS::Internals::Fetch(3)				User Contributed Perl Documentation			     CPANPLUS::Internals::Fetch(3)

NAME
CPANPLUS::Internals::Fetch - internals for fetching files SYNOPSIS
my $output = $cb->_fetch( module => $modobj, fetchdir => '/path/to/save/to', verbose => BOOL, force => BOOL, ); $cb->_add_fail_host( host => 'foo.com' ); $cb->_host_ok( host => 'foo.com' ); DESCRIPTION
CPANPLUS::Internals::Fetch fetches files from either ftp, http, file or rsync mirrors. This is the rough flow: $cb->_fetch Delegate to File::Fetch; METHODS
$path = _fetch( module => $modobj, [fetchdir => '/path/to/save/to', fetch_from => 'scheme://path/to/fetch/from', verbose => BOOL, force => BOOL, prefer_bin => BOOL, ttl => $seconds] ) "_fetch" will fetch files based on the information in a module object. You always need a module object. If you want a fake module object for a one-off fetch, look at "CPANPLUS::Module::Fake". "fetchdir" is the place to save the file to. Usually this information comes from your configuration, but you can override it expressly if needed. "fetch_from" lets you specify an URI to get this file from. If you do not specify one, your list of configured hosts will be probed to download the file from. "force" forces a new download, even if the file already exists. "verbose" simply indicates whether or not to print extra messages. "prefer_bin" indicates whether you prefer the use of commandline programs over perl modules. Defaults to your corresponding config setting. "ttl" (in seconds) indicates how long a cached copy is valid for. If the fetch time of the local copy is within the ttl, the cached copy is returned. Otherwise, the file is refetched. "_fetch" figures out, based on the host list, what scheme to use and from there, delegates to "File::Fetch" do the actual fetching. Returns the path of the output file on success, false on failure. Note that you can set a "blacklist" on certain methods in the config. Simply add the identifying name of the method (ie, "lwp") to: $conf->_set_fetch( blacklist => ['lwp'] ); And the "LWP" function will be skipped by "File::Fetch". _add_fail_host( host => $host_hashref ) Mark a particular host as bad. This makes "CPANPLUS::Internals::Fetch" skip it in fetches until this cache is flushed. _host_ok( host => $host_hashref ) Query the cache to see if this host is ok, or if it has been flagged as bad. Returns true if the host is ok, false otherwise. perl v5.16.3 2013-05-20 CPANPLUS::Internals::Fetch(3)

Check Out this Related Man Page

CPANPLUS::Internals::Extract(3pm)			 Perl Programmers Reference Guide			 CPANPLUS::Internals::Extract(3pm)

NAME
CPANPLUS::Internals::Extract - internals for archive extraction SYNOPSIS
### for source files ### $self->_gunzip( file => 'foo.gz', output => 'blah.txt' ); ### for modules/packages ### $dir = $self->_extract( module => $modobj, extractdir => '/some/where' ); DESCRIPTION
CPANPLUS::Internals::Extract extracts compressed files for CPANPLUS. It can do this by either a pure perl solution (preferred) with the use of "Archive::Tar" and "Compress::Zlib", or with binaries, like "gzip" and "tar". The flow looks like this: $cb->_extract Delegate to Archive::Extract METHODS
$dir = _extract( module => $modobj, [perl => '/path/to/perl', extractdir => '/path/to/extract/to', prefer_bin => BOOL, verbose => BOOL, force => BOOL] ) "_extract" will take a module object and extract it to "extractdir" if provided, or the default location which is obtained from your config. The file name is obtained by looking at "$modobj->status->fetch" and will be parsed to see if it's a tar or zip archive. If it's a zip archive, "__unzip" will be called, otherwise "__untar" will be called. In the unlikely event the file is of neither format, an error will be thrown. "_extract" takes the following options: module A "CPANPLUS::Module" object. This is required. extractdir The directory to extract the archive to. By default this looks something like: /CPANPLUS_BASE/PERL_VERSION/BUILD/MODULE_NAME prefer_bin A flag indicating whether you prefer a pure perl solution, ie "Archive::Tar" or "Archive::Zip" respectively, or a binary solution like "unzip" and "tar". perl The path to the perl executable to use for any perl calls. Also used to determine the build version directory for extraction. verbose Specifies whether to be verbose or not. Defaults to your corresponding config entry. force Specifies whether to force the extraction or not. Defaults to your corresponding config entry. All other options are passed on verbatim to "__unzip" or "__untar". Returns the directory the file was extracted to on success and false on failure. perl v5.18.2 2014-01-06 CPANPLUS::Internals::Extract(3pm)
Man Page