.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "CPANPLUS::Internals::Extract 3pm" .TH CPANPLUS::Internals::Extract 3pm "2021-11-24" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" CPANPLUS::Internals::Extract \- internals for archive extraction .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& ### for source files ### \& $self\->_gunzip( file => \*(Aqfoo.gz\*(Aq, output => \*(Aqblah.txt\*(Aq ); \& \& ### for modules/packages ### \& $dir = $self\->_extract( module => $modobj, \& extractdir => \*(Aq/some/where\*(Aq ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" CPANPLUS::Internals::Extract extracts compressed files for \s-1CPANPLUS.\s0 It can do this by either a pure perl solution (preferred) with the use of \f(CW\*(C`Archive::Tar\*(C'\fR and \f(CW\*(C`Compress::Zlib\*(C'\fR, or with binaries, like \&\f(CW\*(C`gzip\*(C'\fR and \f(CW\*(C`tar\*(C'\fR. .PP The flow looks like this: .PP .Vb 2 \& $cb\->_extract \& Delegate to Archive::Extract .Ve .SH "METHODS" .IX Header "METHODS" .ie n .SS "$dir = _extract( module => $modobj, [perl => '/path/to/perl', extractdir => '/path/to/extract/to', prefer_bin => \s-1BOOL,\s0 verbose => \s-1BOOL,\s0 force => \s-1BOOL\s0] )" .el .SS "\f(CW$dir\fP = _extract( module => \f(CW$modobj\fP, [perl => '/path/to/perl', extractdir => '/path/to/extract/to', prefer_bin => \s-1BOOL,\s0 verbose => \s-1BOOL,\s0 force => \s-1BOOL\s0] )" .IX Subsection "$dir = _extract( module => $modobj, [perl => '/path/to/perl', extractdir => '/path/to/extract/to', prefer_bin => BOOL, verbose => BOOL, force => BOOL] )" \&\f(CW\*(C`_extract\*(C'\fR will take a module object and extract it to \f(CW\*(C`extractdir\*(C'\fR if provided, or the default location which is obtained from your config. .PP The file name is obtained by looking at \f(CW\*(C`$modobj\->status\->fetch\*(C'\fR and will be parsed to see if it's a tar or zip archive. .PP If it's a zip archive, \f(CW\*(C`_\|_unzip\*(C'\fR will be called, otherwise \f(CW\*(C`_\|_untar\*(C'\fR will be called. In the unlikely event the file is of neither format, an error will be thrown. .PP \&\f(CW\*(C`_extract\*(C'\fR takes the following options: .IP "module" 4 .IX Item "module" A \f(CW\*(C`CPANPLUS::Module\*(C'\fR object. This is required. .IP "extractdir" 4 .IX Item "extractdir" The directory to extract the archive to. By default this looks something like: /CPANPLUS_BASE/PERL_VERSION/BUILD/MODULE_NAME .IP "prefer_bin" 4 .IX Item "prefer_bin" A flag indicating whether you prefer a pure perl solution, ie \&\f(CW\*(C`Archive::Tar\*(C'\fR or \f(CW\*(C`Archive::Zip\*(C'\fR respectively, or a binary solution like \f(CW\*(C`unzip\*(C'\fR and \f(CW\*(C`tar\*(C'\fR. .IP "perl" 4 .IX Item "perl" The path to the perl executable to use for any perl calls. Also used to determine the build version directory for extraction. .IP "verbose" 4 .IX Item "verbose" Specifies whether to be verbose or not. Defaults to your corresponding config entry. .IP "force" 4 .IX Item "force" Specifies whether to force the extraction or not. Defaults to your corresponding config entry. .PP All other options are passed on verbatim to \f(CW\*(C`_\|_unzip\*(C'\fR or \f(CW\*(C`_\|_untar\*(C'\fR. .PP Returns the directory the file was extracted to on success and false on failure.