cvs: pear-core /PEAR Downloader.php Validate.php

From: Date: Tue, 22 Feb 2005 04:45:18 +0000
Subject: cvs: pear-core /PEAR Downloader.php Validate.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-29648@lists.php.net to get a copy of this message
cellog Mon Feb 21 23:45:18 2005 EDT Modified files: /pear-core/PEAR Downloader.php Validate.php Log: fix Bug #3550: Bug #3550 1.4.0: pear install PEAR_Frontend_Web-beta works, and shouldn't with current

http://cvs.php.net/diff.php/pear-core/PEAR/Downloader.php?r1=1.60&r2=1.61&ty=u Index: pear-core/PEAR/Downloader.php diff -u pear-core/PEAR/Downloader.php:1.60 pear-core/PEAR/Downloader.php:1.61 --- pear-core/PEAR/Downloader.php:1.60 Thu Feb 17 18:42:30 2005 +++ pear-core/PEAR/Downloader.php Mon Feb 21 23:45:18 2005 @@ -19,7 +19,7 @@ // | Martin Jansen <mj@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Downloader.php,v 1.60 2005/02/17 23:42:30 cellog Exp $ +// $Id: Downloader.php,v 1.61 2005/02/22 04:45:18 cellog Exp $ require_once 'PEAR/Common.php'; require_once 'PEAR/ChannelFile.php'; @@ -331,9 +331,11 @@ */ function analyzeDependencies(&$params) { + $failed = false; if (isset($this->_options['downloadonly'])) { return; } + PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); foreach ($params as $i => $param) { $deps = $param->getDeps(); if (!$deps) { @@ -345,7 +347,6 @@ if (count($deps)) { $depchecker = &$this->getDependency2Object($this->config, $this->getOptions(), $param->getParsedPackage(), PEAR_VALIDATE_DOWNLOADING); - PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); if ($param->getType() == 'xmlrpc') { $send = $param->getDownloadURL(); } else { @@ -488,19 +489,19 @@ } } } - PEAR::staticPopErrorHandling(); $params[$i]->setValidated(); - if ($failed) { - if (isset($this->_options['ignore-errors']) || isset($this->_options['nodeps'])) { - // this is probably not needed, but just in case - if (!isset($this->_options['soft'])) { - $this->log(0, 'WARNING: dependencies failed'); - } - return; - } - return PEAR::raiseError("Cannot install, dependencies failed"); + } + } + PEAR::staticPopErrorHandling(); + if ($failed) { + if (isset($this->_options['ignore-errors']) || isset($this->_options['nodeps'])) { + // this is probably not needed, but just in case + if (!isset($this->_options['soft'])) { + $this->log(0, 'WARNING: dependencies failed'); } + return; } + return PEAR::raiseError("Cannot install, dependencies failed"); } } http://cvs.php.net/diff.php/pear-core/PEAR/Validate.php?r1=1.31&r2=1.32&ty=u Index: pear-core/PEAR/Validate.php diff -u pear-core/PEAR/Validate.php:1.31 pear-core/PEAR/Validate.php:1.32 --- pear-core/PEAR/Validate.php:1.31 Sat Nov 27 20:32:40 2004 +++ pear-core/PEAR/Validate.php Mon Feb 21 23:45:18 2005 @@ -16,7 +16,7 @@ // | Authors: Gregory Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Validate.php,v 1.31 2004/11/28 01:32:40 cellog Exp $ +// $Id: Validate.php,v 1.32 2005/02/22 04:45:18 cellog Exp $ define('PEAR_VALIDATE_INSTALLING', 1); define('PEAR_VALIDATE_UNINSTALLING', 2); // this is not bit-mapped like the others define('PEAR_VALIDATE_NORMAL', 3); @@ -257,10 +257,10 @@ 'version "' . $version . '" should be "' . implode('.' ,$versioncomponents) . '"'); } else { - $this->_addFailure('version', + $this->_addWarning('version', 'packages with devel stability must be < version 1.0.0'); } - return false; + return true; break; case 'alpha' : case 'beta' : @@ -271,30 +271,30 @@ if ($versioncomponents[2]{0} == '0') { if ($versioncomponents[2] == '0') { // version 1.*.0000 - $this->_addFailure('version', + $this->_addWarning('version', 'version 1.' . $versioncomponents[1] . '.0 cannot be alpha or beta'); - return false; + return true; } elseif (strlen($versioncomponents[2]) > 1) { // version 1.*.0RC1 or 1.*.0beta24 etc. return true; } else { // version 1.*.0 - $this->_addFailure('version', + $this->_addWarning('version', 'version 1.' . $versioncomponents[1] . '.0 cannot be alpha or beta'); - return false; + return true; } } else { - $this->_addFailure('version', + $this->_addWarning('version', 'bugfix versions (1.3.x where x > 0) cannot be alpha or beta'); - return false; + return true; } } elseif ($versioncomponents[0] != '0') { - $this->_addFailure('version', + $this->_addWarning('version', 'major versions greater than 1 are not allowed for packages ' . 'without an <extends> tag or an identical postfix (foo2 v2.0.0)'); - return false; + return true; } if ($versioncomponents[0] . 'a' == '0a') { return true; @@ -312,11 +312,11 @@ $majver = substr($majver, 1); } if (($versioncomponents[0] != 0) && $majver != $versioncomponents[0]) { - $this->_addFailure('version', 'first version number "' . + $this->_addWarning('version', 'first version number "' . $versioncomponents[0] . '" must match the postfix of ' . 'package name "' . $name . '" (' . $majver . ')'); - return false; + return true; } if ($versioncomponents[0] == $majver) { if ($versioncomponents[2]{0} == '0') { @@ -331,27 +331,27 @@ return true; } else { // version 2.*.0 - $this->_addFailure('version', + $this->_addWarning('version', "version $majver." . $versioncomponents[1] . '.0 cannot be alpha or beta'); - return false; + return true; } } else { $this->_addFailure('version', "bugfix versions ($majver.x.y where y > 0) cannot be alpha or beta"); - return false; + return true; } } elseif ($versioncomponents[0] != '0') { - $this->_addFailure('version', + $this->_addWarning('version', "only versions 0.x.y and $majver.x.y"); - return false; + return true; } if ($versioncomponents[0] . 'a' == '0a') { return true; } if ($versioncomponents[0] == 0) { $versioncomponents[0] = '0'; - $this->_addFailure('version', + $this->_addWarning('version', 'version "' . $version . '" should be "' . implode('.' ,$versioncomponents) . '"'); } @@ -360,16 +360,16 @@ break; case 'stable' : if ($versioncomponents[0] == '0') { - $this->_addFailure('version', 'versions less than 1.0.0 cannot ' . + $this->_addWarning('version', 'versions less than 1.0.0 cannot ' . 'be stable'); - return false; + return true; } if (!is_numeric($versioncomponents[2])) { if (preg_match('/\d+(rc|a|alpha|b|beta)\d*/i', $versioncomponents[2])) { - $this->_addFailure('version', 'version "' . $version . '" or any ' . + $this->_addWarning('version', 'version "' . $version . '" or any ' . 'RC/beta/alpha version cannot be stable'); - return false; + return true; } } // check for a package that extends a package, @@ -381,14 +381,14 @@ $majver = substr($majver, 1); } if (($versioncomponents[0] != 0) && $majver != $versioncomponents[0]) { - $this->_addFailure('version', 'first version number "' . + $this->_addWarning('version', 'first version number "' . $versioncomponents[0] . '" must match the postfix of ' . 'package name "' . $name . '" (' . $majver . ')'); - return false; + return true; } } elseif ($versioncomponents[0] > 1) { - $this->_addFailure('version', 'major version x in x.y.z may not be greater than ' . + $this->_addWarning('version', 'major version x in x.y.z may not be greater than ' . '1 for any package that does not have an <extends> tag'); } return true;
« previous php.pear.cvs (#29648) next »