cvs: php4 /pear/PEAR Packager.php
| From: | Thomas V.V.Cox | Date: | Mon, 08 Oct 2001 03:29:35 +0000 |
| Subject: | cvs: php4 /pear/PEAR Packager.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-953@lists.php.net to get a copy of this message | ||
cox Sun Oct 7 23:29:35 2001 EDT
Modified files:
/php4/pear/PEAR Packager.php
Log:
use Tar.php class and clean up some unused properties
Index: php4/pear/PEAR/Packager.php
diff -u php4/pear/PEAR/Packager.php:1.14 php4/pear/PEAR/Packager.php:1.15
--- php4/pear/PEAR/Packager.php:1.14 Sun Oct 7 16:16:41 2001
+++ php4/pear/PEAR/Packager.php Sun Oct 7 23:29:34 2001
@@ -18,7 +18,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: Packager.php,v 1.14 2001/10/07 20:16:41 cox Exp $
+// $Id: Packager.php,v 1.15 2001/10/08 03:29:34 cox Exp $
require_once 'PEAR/Common.php';
@@ -36,18 +36,6 @@
{
// {{{ 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 @@
$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 @@
// 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;