cvs: php4 /pear/PEAR Installer.php Packager.php

From: Date: Mon, 08 Oct 2001 16:52:33 +0000
Subject: cvs: php4 /pear/PEAR Installer.php Packager.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-959@lists.php.net to get a copy of this message
cox Mon Oct 8 12:52:33 2001 EDT Modified files: /php4/pear/PEAR Packager.php Installer.php Log: some clean up Index: php4/pear/PEAR/Packager.php diff -u php4/pear/PEAR/Packager.php:1.15 php4/pear/PEAR/Packager.php:1.16 --- php4/pear/PEAR/Packager.php:1.15 Sun Oct 7 23:29:34 2001 +++ php4/pear/PEAR/Packager.php Mon Oct 8 12:52:33 2001 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Packager.php,v 1.15 2001/10/08 03:29:34 cox Exp $ +// $Id: Packager.php,v 1.16 2001/10/08 16:52:33 cox Exp $ require_once 'PEAR/Common.php'; @@ -86,17 +86,9 @@ // }}} // {{{ destructor - function _PEAR_Packager() { - $this->_PEAR(); - while (is_array($this->_tempfiles) && - $file = array_shift($this->_tempfiles)) - { - if (is_dir($file)) { - System::rm("-rf $file"); - } else { - unlink($file); - } - } + function _PEAR_Packager() + { + $this->_PEAR_Common(); } // }}} @@ -121,9 +113,11 @@ } $pwd = getcwd(); $pkgfile = basename($pkgfile); - $pkgver = $pkginfo['package'] . '-' . $pkginfo['version']; // don't want strange characters - $pkgver = ereg_replace ('[^a-zA-Z0-9._]', '_', $pkgver); + $pkgname = ereg_replace ('[^a-zA-Z0-9._]', '_', $pkginfo['package']); + $pkgversion = ereg_replace ('[^a-zA-Z0-9._\-]', '_', $pkginfo['version']); + $pkgver = $pkgname . '-' . $pkgversion; + $this->tmpdir = $pwd . DIRECTORY_SEPARATOR . $pkgver; if (file_exists($this->tmpdir)) { return $this->raiseError('Tmpdir: ' . $this->tmpdir .' already exists', @@ -135,7 +129,7 @@ } else { $this->log(2, "+ tmp dir created at: " . $this->tmpdir); } - $this->_tempfiles[] = $this->tmpdir; + $this->addTempFile($this->tmpdir); // Copy files ----------------------------------------------- foreach ($pkginfo['filelist'] as $fname => $atts) { Index: php4/pear/PEAR/Installer.php diff -u php4/pear/PEAR/Installer.php:1.20 php4/pear/PEAR/Installer.php:1.21 --- php4/pear/PEAR/Installer.php:1.20 Mon Oct 8 02:12:13 2001 +++ php4/pear/PEAR/Installer.php Mon Oct 8 12:52:33 2001 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Installer.php,v 1.20 2001/10/08 06:12:13 cox Exp $ +// $Id: Installer.php,v 1.21 2001/10/08 16:52:33 cox Exp $ require_once 'PEAR/Common.php'; @@ -81,10 +81,6 @@ function _PEAR_Installer() { chdir($this->pwd); - if ($this->tmpdir && is_dir($this->tmpdir)) { - System::rm("-rf $this->tmpdir"); - } - $this->tmpdir = null; $this->_PEAR_Common(); }

« previous php.pear.cvs (#959) next »