cvs: pear-core /PEAR Validate.php

From: Date: Tue, 22 Feb 2005 05:18:43 +0000
Subject: cvs: pear-core /PEAR Validate.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-29651@lists.php.net to get a copy of this message
cellog Tue Feb 22 00:18:43 2005 EDT Modified files: /pear-core/PEAR Validate.php Log: fix Bug #3522 1.4.0 version validation should only raise warnings for political stuff http://cvs.php.net/diff.php/pear-core/PEAR/Validate.php?r1=1.32&r2=1.33&ty=u Index: pear-core/PEAR/Validate.php diff -u pear-core/PEAR/Validate.php:1.32 pear-core/PEAR/Validate.php:1.33 --- pear-core/PEAR/Validate.php:1.32 Mon Feb 21 23:45:18 2005 +++ pear-core/PEAR/Validate.php Tue Feb 22 00:18:43 2005 @@ -16,7 +16,7 @@ // | Authors: Gregory Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Validate.php,v 1.32 2005/02/22 04:45:18 cellog Exp $ +// $Id: Validate.php,v 1.33 2005/02/22 05:18:43 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); @@ -253,11 +253,11 @@ } if ($versioncomponents[0] == 0) { $versioncomponents[0] = '0'; - $this->_addFailure('version', + $this->_addWarning('version', 'version "' . $version . '" should be "' . implode('.' ,$versioncomponents) . '"'); } else { - $this->_addWarning('version', + $this->_addFailure('version', 'packages with devel stability must be < version 1.0.0'); } return true; @@ -273,7 +273,7 @@ // version 1.*.0000 $this->_addWarning('version', 'version 1.' . $versioncomponents[1] . - '.0 cannot be alpha or beta'); + '.0 probably should not be alpha or beta'); return true; } elseif (strlen($versioncomponents[2]) > 1) { // version 1.*.0RC1 or 1.*.0beta24 etc. @@ -282,12 +282,13 @@ // version 1.*.0 $this->_addWarning('version', 'version 1.' . $versioncomponents[1] . - '.0 cannot be alpha or beta'); + '.0 probably should not be alpha or beta'); return true; } } else { $this->_addWarning('version', - 'bugfix versions (1.3.x where x > 0) cannot be alpha or beta'); + 'bugfix versions (1.3.x where x > 0) probably should ' . + 'not be alpha or beta'); return true; } } elseif ($versioncomponents[0] != '0') { @@ -301,7 +302,7 @@ } if ($versioncomponents[0] == 0) { $versioncomponents[0] = '0'; - $this->_addFailure('version', + $this->_addWarning('version', 'version "' . $version . '" should be "' . implode('.' ,$versioncomponents) . '"'); } @@ -322,9 +323,9 @@ if ($versioncomponents[2]{0} == '0') { if ($versioncomponents[2] == '0') { // version 2.*.0000 - $this->_addFailure('version', + $this->_addWarning('version', "version $majver." . $versioncomponents[1] . - '.0 cannot be alpha or beta'); + '.0 probably should not be alpha or beta'); return false; } elseif (strlen($versioncomponents[2]) > 1) { // version 2.*.0RC1 or 2.*.0beta24 etc. @@ -337,13 +338,14 @@ return true; } } else { - $this->_addFailure('version', - "bugfix versions ($majver.x.y where y > 0) cannot be alpha or beta"); + $this->_addWarning('version', + "bugfix versions ($majver.x.y where y > 0) should " . + 'not be alpha or beta'); return true; } } elseif ($versioncomponents[0] != '0') { $this->_addWarning('version', - "only versions 0.x.y and $majver.x.y"); + "only versions 0.x.y and $majver.x.y are allowed for alpha/beta releases"); return true; } if ($versioncomponents[0] . 'a' == '0a') {

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