Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.14

Bug #18309 Cannot install validation package because installer tries to validate it
Submitted: 2011-02-24 21:04 UTC
From: yunosh Assigned: dufuz
Status: Assigned Package: PEAR (version 1.9.1)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    

 [2011-02-24 21:04 UTC] yunosh (Jan Schneider)
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.


 [2011-02-24 23:20 UTC] yunosh (Jan Schneider)
 [2011-02-27 21:16 UTC] dufuz (Helgi Þormar Þorbjörnsson)
Do you have an example custom validation which reproduces the problem? Would be useful to write tests.
 [2011-03-01 16:21 UTC] yunosh (Jan Schneider) or $ pear channel-discover $ pear install horde/horde_validate_package-alpha
 [2011-03-01 22:03 UTC] yunosh (Jan Schneider)
 [2011-03-01 22:05 UTC] yunosh (Jan Schneider)
A more complete validator is available from now. This is a package.xml file to test the patches: <?xml version="1.0" encoding="UTF-8"?> <package packagerversion="1.9.2" version="2.0" xmlns="" xmlns:tasks="" xmlns:xsi="" xsi:schemaLocation=""> <name>test</name> <channel></channel> <summary>Test application</summary> <description>Just for testing.</description> <lead> <name>Jan Schneider</name> <user>jan</user> <email></email> <active>yes</active> </lead> <date>2011-03-01</date> <time>16:58:37</time> <version> <release>4.0-beta</release> <api>1.0</api> </version> <stability> <release>beta</release> <api>alpha</api> </stability> <license uri="">BSD</license> <notes> * Initial release. </notes> <contents> <dir baseinstalldir="/" name="/"> <file name="README" role="data" /> </dir> <!-- / --> </contents> <dependencies> <required> <php> <min>5.2.0</min> </php> <pearinstaller> <min>1.7.0</min> </pearinstaller> </required> </dependencies> <phprelease /> <changelog> <release> <version> <release>4.0-beta</release> <api>1.0</api> </version> <stability> <release>beta</release> <api>alpha</api> </stability> <date>2011-03-01</date> <license uri="">BSD</license> <notes> * Initial release. </notes> </release> </changelog> </package>
 [2011-03-01 22:10 UTC] yunosh (Jan Schneider)
Oh, one more comment to my 2nd revision of the patch. This one also remove the $this->_validateStabilityVersion(); call, because version checking already happens futher down, and there it correctly uses the channel's validator, while $this->_validateStabilityVersion() only uses some simple regexp checking, i.e. not even PEAR's internal validator. Maybe this method can go away completely, or reduced to basic schema checking.
 [2011-03-09 03:37 UTC] dufuz (Helgi Þormar Þorbjörnsson)
-Assigned To: +Assigned To: dufuz
 [2011-03-09 07:29 UTC] dufuz (Helgi Þormar Þorbjörnsson)
Doesn't look like horde_validate_package is available through the channel anymore.
 [2011-03-09 07:38 UTC] yunosh (Jan Schneider)
Yes, the PEAR server has been rebuilt today and we gave up on custom validation because it simply doen't work at this point. I can send the package to you personally though.
 [2011-03-09 07:51 UTC] dufuz (Helgi Þormar Þorbjörnsson)
Please do, I would like to get this working if possible. Seems tho if you couldn't get it working then it was inherently broken for everyone and thus no one is really using it, thus removing the feature wouldn't be a big leap. Hrmmm! :-)