Edit report at http://pear.php.net/bugs/bug.php?id=18309&edit=1
ID: 18309
Updated by: [email protected]
Reported By: jan at horde dot org
Summary: Cannot install validation package because installer
tries to validate it
Status: Open
Type: Bug
Package: PEAR
Package Version: 1.9.1
PHP Version: Irrelevant
Roadmap Versions:
New Comment:
http://pear.horde.org/index.php?package=Horde_Validate_Package&release=0.99.1&downloads
or
$ pear channel-discover pear.horde.org
$ pear install horde/horde_validate_package-alpha
Previous Comments:
------------------------------------------------------------------------
[2011-02-27 16:16:07] dufuz
Do you have an example custom validation which reproduces the problem?
Would be
useful to write tests.
------------------------------------------------------------------------
[2011-02-24 18:20:01] yunosh
Added #patch
bug:18309;patch:fix_validator_installation.diff;revision:1298571601;.
------------------------------------------------------------------------
[2011-02-24 16:04:16] yunosh
Description:
------------
To avoid the chicken-and-egg problem, the PEAR installer is supposed to
always validate channel validator packages with PEAR_Validate. The
detection of validator packages is broken though.
The check is done in PEAR_ChannelFile::getValidationObject():
if ($package == $this->_channelInfo['validatepackage']) {
// channel validation packages are always validated by
PEAR_Validate
$val = &new PEAR_Validate;
return $val;
}
This check is broken in two ways though.
1) The package name is in
$this->_channelInfo['validatepackage']['_content'] not
$this->_channelInfo['validatepackage'].
2) $package is not passed as a parameter to this method.
The method is called from PEAR_Registry::parsePackageName():
$validate = $chan->getValidationObject();
This should be:
$validate = $chan->getValidationObject($param['package']);
As a side-note, everything breaks completely with a fatal error, because
getValidationObject() might return false, which happens in this case,
yet the return value is unconditionally used as an object in
parsePackageName().
I don't see a workaround, so <validatepackage> support is completey
brocken at the moment.
------------------------------------------------------------------------