1CPANPLUS::Internals::ExUtsrearctC(o3n)tributed Perl DocuCmPeAnNtPaLtUiSo:n:Internals::Extract(3)
2
3
4

NAME

6       CPANPLUS::Internals::Extract - internals for archive extraction
7

SYNOPSIS

9           ### for source files ###
10           $self->_gunzip( file => 'foo.gz', output => 'blah.txt' );
11
12           ### for modules/packages ###
13           $dir = $self->_extract( module      => $modobj,
14                                   extractdir  => '/some/where' );
15

DESCRIPTION

17       CPANPLUS::Internals::Extract extracts compressed files for CPANPLUS.
18       It can do this by either a pure perl solution (preferred) with the use
19       of "Archive::Tar" and "Compress::Zlib", or with binaries, like "gzip"
20       and "tar".
21
22       The flow looks like this:
23
24           $cb->_extract
25               Delegate to Archive::Extract
26

METHODS

28   $dir = _extract( module => $modobj, [perl => '/path/to/perl', extractdir =>
29       '/path/to/extract/to', prefer_bin => BOOL, verbose => BOOL, force =>
30       BOOL] )
31       "_extract" will take a module object and extract it to "extractdir" if
32       provided, or the default location which is obtained from your config.
33
34       The file name is obtained by looking at "$modobj->status->fetch" and
35       will be parsed to see if it's a tar or zip archive.
36
37       If it's a zip archive, "__unzip" will be called, otherwise "__untar"
38       will be called. In the unlikely event the file is of neither format, an
39       error will be thrown.
40
41       "_extract" takes the following options:
42
43       module
44           A "CPANPLUS::Module" object. This is required.
45
46       extractdir
47           The directory to extract the archive to. By default this looks
48           something like:
49               /CPANPLUS_BASE/PERL_VERSION/BUILD/MODULE_NAME
50
51       prefer_bin
52           A flag indicating whether you prefer a pure perl solution, ie
53           "Archive::Tar" or "Archive::Zip" respectively, or a binary solution
54           like "unzip" and "tar".
55
56       perl
57           The path to the perl executable to use for any perl calls. Also
58           used to determine the build version directory for extraction.
59
60       verbose
61           Specifies whether to be verbose or not. Defaults to your
62           corresponding config entry.
63
64       force
65           Specifies whether to force the extraction or not. Defaults to your
66           corresponding config entry.
67
68       All other options are passed on verbatim to "__unzip" or "__untar".
69
70       Returns the directory the file was extracted to on success and false on
71       failure.
72
73
74
75perl v5.30.1                      2019-12-10   CPANPLUS::Internals::Extract(3)
Impressum