.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 3" .TH CPANPLUS::Internals::Extract 3 2023-07-25 "perl v5.38.0" "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 CPANPLUS. 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 => BOOL, verbose => BOOL, force => BOOL] )" .el .SS "\f(CW$dir\fP = _extract( module => \f(CW$modobj\fP, [perl => '/path/to/perl', extractdir => '/path/to/extract/to', prefer_bin => BOOL, verbose => BOOL, force => BOOL] )" .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.