cvs: php4 /pear/PEAR Installer.php

From: Date: Fri, 14 Jun 2002 23:18:08 +0000
Subject: cvs: php4 /pear/PEAR Installer.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4628@lists.php.net to get a copy of this message
cox Fri Jun 14 19:18:08 2002 EDT Modified files: /php4/pear/PEAR Installer.php Log: - Fix issue with the DIRECTORY_SEPARATOR, did make the install of XML_image2svg fail - TODO++ and others minor stuff Index: php4/pear/PEAR/Installer.php diff -u php4/pear/PEAR/Installer.php:1.67 php4/pear/PEAR/Installer.php:1.68 --- php4/pear/PEAR/Installer.php:1.67 Sat Jun 8 13:34:46 2002 +++ php4/pear/PEAR/Installer.php Fri Jun 14 19:18:04 2002 @@ -17,7 +17,7 @@ // | Tomas V.V.Cox <cox@idecnet.com> | // +----------------------------------------------------------------------+ // -// $Id: Installer.php,v 1.67 2002/06/08 17:34:46 cox Exp $ +// $Id: Installer.php,v 1.68 2002/06/14 23:18:04 cox Exp $ require_once 'PEAR/Common.php'; require_once 'PEAR/Registry.php'; @@ -33,6 +33,9 @@ * * TODO: * - Check dependencies break on package uninstall (when no force given) + * - add a guessInstallDest() method with the code from _installFile() and + * use that method in Registry::_rebuildFileMap() & Command_Registry::doList(), + * others.. * * @since PHP 4.0.2 * @author Stig Bakken <ssb@fast.no> @@ -192,10 +195,13 @@ } else { $dest_file = $dest_dir . DIRECTORY_SEPARATOR . $atts['install-as']; } + $orig_file = $tmp_path . DIRECTORY_SEPARATOR . $file; + + // Clean up the DIRECTORY_SEPARATOR mess $ds2 = str_repeat(DIRECTORY_SEPARATOR, 2); - $dest_file = preg_replace(array('!\\\\!', '!/!', "!$ds2+!"), - DIRECTORY_SEPARATOR, - $dest_file); + list($dest_file, $orig_file) = preg_replace(array('!\\\\!', '!/!', "!$ds2+!"), + DIRECTORY_SEPARATOR, + array($dest_file, $orig_file)); $dest_dir = dirname($dest_file); if (!@is_dir($dest_dir)) { if (!$this->mkDirHier($dest_dir)) { @@ -204,7 +210,6 @@ } $this->log(3, "+ mkdir $dest_dir"); } - $orig_file = $tmp_path . DIRECTORY_SEPARATOR . $file; if (empty($atts['replacements'])) { if (!@copy($orig_file, $dest_file)) { return $this->raiseError("failed to copy $orig_file to $dest_file", @@ -393,7 +398,7 @@ $pkgname = $pkginfo['package']; // Check dependencies ------------------------------------------- - if (isset($pkginfo['release_deps']) && !isset($options['nodeps'])) { + if (isset($pkginfo['release_deps']) && empty($options['nodeps'])) { $error = $this->checkDeps($pkginfo); if ($error) { if (empty($options['soft'])) { @@ -409,7 +414,7 @@ return $this->raiseError("$pkgname already installed"); } } else { - // check to do only when upgrading packages + // checks to do only when upgrading packages if (!$this->registry->packageExists($pkgname)) { return $this->raiseError("$pkgname not installed"); }

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