cvs: pear-core /PEAR Installer.php

From: Date: Thu, 09 Apr 2009 00:55:07 +0000
Subject: cvs: pear-core /PEAR Installer.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-8309@lists.php.net to get a copy of this message
dufuz Thu Apr 9 00:55:07 2009 UTC Modified files: /pear-core/PEAR Installer.php Log: Bug #14792 Bad md5sum for some files http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Installer.php?r1=1.258&r2=1.259&diff_format=u Index: pear-core/PEAR/Installer.php diff -u pear-core/PEAR/Installer.php:1.258 pear-core/PEAR/Installer.php:1.259 --- pear-core/PEAR/Installer.php:1.258 Thu Mar 5 00:32:13 2009 +++ pear-core/PEAR/Installer.php Thu Apr 9 00:55:07 2009 @@ -12,7 +12,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Installer.php,v 1.258 2009/03/05 00:32:13 dufuz Exp $ + * @version CVS: $Id: Installer.php,v 1.259 2009/04/09 00:55:07 dufuz Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -587,8 +587,7 @@ } foreach ($atts as $tag => $raw) { - $tag = str_replace(array($pkg->getTasksNs() . ':', '-'), - array('', '_'), $tag); + $tag = str_replace(array($pkg->getTasksNs() . ':', '-'), array('', '_'), $tag); $task = "PEAR_Task_$tag"; $task = &new $task($this->config, $this, PEAR_TASK_INSTALL); if (!$task->isScript()) { // scripts are only handled after installation @@ -601,8 +600,10 @@ if (PEAR::isError($res)) { return $res; } + $contents = $res; // save changes } + $wp = @fopen($dest_file, "wb"); if (!is_resource($wp)) { return $this->raiseError("failed to create $dest_file: $php_errormsg", @@ -620,8 +621,14 @@ // {{{ check the md5 if (isset($md5sum)) { + // Make sure the original md5 sum matches with expected if (strtolower($md5sum) === strtolower($attribs['md5sum'])) { $this->log(2, "md5sum ok: $final_dest_file"); + + if (isset($contents)) { + // set md5 sum based on $content in case any tasks were run. + $real_atts['attribs']['md5sum'] = md5($contents); + } } else { if (empty($options['force'])) { // delete the file

« previous php.pear.core (#8309) next »