#25008 [NEW]: unhelpful Installer Error Message

From: Date: Mon, 11 Aug 2003 00:33:19 +0000
Subject: #25008 [NEW]: unhelpful Installer Error Message
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19492@lists.php.net to get a copy of this message
From: cellog@php.net Operating system: na PHP version: 4.3.3RC3 PHP Bug Type: PEAR related Bug description: unhelpful Installer Error Message Description: ------------ if you try to install a package from a package.xml, and a file is listed in the package.xml that doesn't exist, the error message is not helpful. This patch changes the error message to let you know what happened Index: pear/PEAR/Installer.php =================================================================== RCS file: /repository/php-src/pear/PEAR/Installer.php,v retrieving revision 1.93 diff -u -r1.93 Installer.php --- pear/PEAR/Installer.php 4 Aug 2003 13:31:35 -0000 1.93 +++ pear/PEAR/Installer.php 11 Aug 2003 00:29:45 -0000 @@ -222,6 +222,10 @@ $this->log(3, "+ mkdir $dest_dir"); } if (empty($atts['replacements'])) { + if (!file_exists($orig_file)) { + return $this->raiseError("file does not exist", + PEAR_INSTALLER_FAILED); + } if (!@copy($orig_file, $dest_file)) { return $this->raiseError("failed to write $dest_file", PEAR_INSTALLER_FAILED); @@ -231,6 +235,10 @@ $md5sum = md5_file($dest_file); } } else { + if (!file_exists($orig_file)) { + return $this->raiseError("file does not exist", + PEAR_INSTALLER_FAILED); + } $fp = fopen($orig_file, "r"); $contents = fread($fp, filesize($orig_file)); fclose($fp); @@ -695,6 +703,9 @@ if (PEAR::isError($res)) { if (empty($options['ignore-errors'])) { $this->rollbackFileTransaction(); + if ($res->getMessage() == "file does not exist") { + $this->raiseError("file $file in package.xml does not exist"); + } return $this->raiseError($res); } else { $this->log(0, "Warning: " . $res->getMessage()); Expected result: ---------------- file XXX in package.xml does not exist Actual result: -------------- failed to write /temppath/.tmpXXX -- Edit bug report at http://bugs.php.net/?id=25008&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25008&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25008&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25008&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25008&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25008&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25008&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25008&r=support Expected behavior: http://bugs.php.net/fix.php?id=25008&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25008&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25008&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25008&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25008&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25008&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25008&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25008&r=gnused

« previous php.pear.dev (#19492) next »