From: Tomas V.V.Cox Date: Mon, 8 Oct 2001 03:29:34 +0000 (+0000) Subject: use Tar.php class and clean up some unused properties X-Git-Tag: PRE_PARAMETER_PARSING_API~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28f5a1e6e9117a0e4f26a59300edeeb80e927793;p=php use Tar.php class and clean up some unused properties --- diff --git a/pear/PEAR/Packager.php b/pear/PEAR/Packager.php index acc116898b..61e042087b 100644 --- a/pear/PEAR/Packager.php +++ b/pear/PEAR/Packager.php @@ -36,18 +36,6 @@ class PEAR_Packager extends PEAR_Common { // {{{ properties - /** XML_Parser object */ - var $parser; - - /** stack of elements, gives some sort of XML context */ - var $element_stack; - - /** name of currently parsed XML element */ - var $current_element; - - /** array of attributes of the currently parsed XML element */ - var $current_attributes = array(); - /** assoc with information about the package */ var $pkginfo = array(); @@ -104,7 +92,7 @@ class PEAR_Packager extends PEAR_Common $file = array_shift($this->_tempfiles)) { if (is_dir($file)) { - System::rm("-rf $file"); // XXX FIXME Windows + System::rm("-rf $file"); } else { unlink($file); } @@ -180,11 +168,12 @@ class PEAR_Packager extends PEAR_Common // TAR the Package ------------------------------------------- chdir(dirname($this->tmpdir)); $dest_package = $orig_pwd . DIRECTORY_SEPARATOR . "${pkgver}.tgz"; - // XXX FIXME Windows and non-GNU tar - $cmd = "tar -cvzf $dest_package $pkgver"; - $this->log(2, "+ launched cmd: $cmd"); - // XXX TODO: add an extra param where to leave the package? - $this->log(1, `$cmd`); + $this->log(2, "Attempting to pack {$this->tmpdir} $contents_dir dir in $dest_package"); + $tar = new Archive_Tar($dest_package, true); + $tar->setErrorHandling(PEAR_ERROR_PRINT); + if (!$tar->create($pkgver)) { + return $this->raiseError('an error ocurred during package creation'); + } $this->log(1, "Package $dest_package done"); chdir($orig_pwd); return $dest_package;