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

Bug #6675 postinstallscript validation fails
Submitted: 2006-02-02 17:53 UTC
From: hans at velum dot ent Assigned: cellog
Status: No Feedback Package: PEAR (version 1.4.6)
PHP Version: 5.1.2 OS: Gentoo Linux
Roadmaps: (Not assigned)    
Subscription  


 [2006-02-02 17:53 UTC] hans at velum dot ent
Description: ------------ When attempting to install a package that uses <task:postinstallscript> I get errors like this (I'm trying to install Chiara_PEAR_Server): task <tasks:postinstallscript> in file Server/mysqlinstall.php is invalid because of "Post-install script "Server/mysqlinstall.php" must declare exactly 1 class" Parsing of package.xml from file "/tmp/tmpOvtlaj/package.xml" failed Cannot initialize 'Chiara_PEAR_Server-0.18.3.tgz', invalid or missing package file Package "Chiara_PEAR_Server-0.18.3.tgz" is not valid install failed Well, Server/mysqlinstall.php does declare exactly 1 class. This would appear to be a bug in PEAR_Task_Postinstallscript and/or PEAR_PackageFile_v2 (depending on how you look at it). What seems to be the problem: On/around line 82, PEAR_Task_Postinstallscript calls $pkg->analyzeSourceCode($file, true); $file is the contents of the file, not the file _name_ which appears to be what is expected by PEAR_PackageFile_v2.

Comments

 [2006-02-04 02:15 UTC] cellog
Thank you for taking the time to report a problem with the package. This problem may have been already fixed by a previous change that is in the CVS of the package. Please log into CVS with: cvs -d :pserver:anoncvs@cvs.php.net:/repository login and check out the CVS repository of this package and upgrade cvs -d :pserver:anoncvs@cvs.php.net:/repository co pear-core pear upgrade pear-core/package2.xml or pear upgrade pear-core/package.xml If you are able to reproduce the bug with the latest CVS, please change the status back to "Open". Again, thank you for your continued support of PEAR.
 [2006-02-06 21:25 UTC] hans at velum dot ent
When I upgrade PEAR per CVS instructions (which incidentally seem wrong, since 'anoncvs' is not a valid CVS user), I get the same error. Furthermore after the upgrade (which it says was successful), PEAR is still at version 1.4.7.
 [2006-02-07 03:39 UTC] cellog
turns out, there must be another issue. Could you verify these facts: PEAR/PackageFile/v2/Validator.php is: $Id: Validator.php,v 1.84 2006/01/28 17:33:25 cellog Exp $ PEAR/Task/Posinstallscript.php is: $Id: Postinstallscript.php,v 1.17 2006/01/06 04:47:37 cellog Exp $ the second parameter to analyzeSourceCode() tells the validator to expect the file contents instead of the file name.
 [2006-02-07 15:50 UTC] hans at velum dot ent
oh, ok, my apologies. yes, I think this is a differnet type of bug afterall. I am missing the tokenizer and the analyzeSourceCode() in the validator is returning false if the tokenizer is not present. -- It also returns false if it can't open the file, which is I think what made me think it was related to the param type. I see the error of my ways, though, by the if ($string) check :)
 [2006-02-08 01:15 UTC] cellog
aha - the way errors are handled is incorrect. Thank you
 [2006-02-08 01:21 UTC] cellog
Thank you for taking the time to report a problem with the package. This problem may have been already fixed by a previous change that is in the CVS of the package. Please log into CVS with: cvs -d :pserver:cvsread@cvs.php.net:/repository login and check out the CVS repository of this package and upgrade cvs -d :pserver:cvsread@cvs.php.net:/repository co pear-core pear upgrade pear-core/package2.xml or pear upgrade pear-core/package.xml If you are able to reproduce the bug with the latest CVS, please change the status back to "Open". Again, thank you for your continued support of PEAR.