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

Bug #12816 <configureoption> default isn't being parsed
Submitted: 2008-01-03 16:53 UTC
From: jon Assigned: jon
Status: Closed Package: PEAR
PHP Version: 5_2 CVS-2007-12-02 OS: FreeBSD 6.2
Roadmaps: 1.7.0    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 33 + 44 = ?

 
 [2008-01-03 16:53 UTC] jon (Jon Parise)
Description: ------------ The <default> sub-element of the <configureoption> tag in the package.xml file doesn't appear to be getting parsed by the PEAR installer. My package.xml file contains the following, as generated by PEAR_PackageFileManager2: <configureoption name="with-perforce" prompt="Path to P4API"> <default>autodetect</default> </configureoption> When I run a command like 'pear build package.xml', the UI prompt for the option has a null value. I looked in PEAR/Builder.php, and the configure_option array for this entry did not contain a 'default' value. I looked in PEAR/PackageFile/Parser/* and didn't see any code that would parse the <default> sub-element, either. This also indirectly breaks the 'autodetect' capability. Test script: --------------- Add something like this to the package.xml file for an extension: <configureoption name="with-perforce" prompt="Path to P4API"> <default>autodetect</default> </configureoption> This can be done using PEAR_PackageFileManager2: $package->addConfigureOption('with-perforce', 'Path to P4API', 'autodetect'); Then, run 'pear build package.xml' and observe that no default value is displayed. Expected result: ---------------- The <default> sub-element of the <configureoption> tag is honored at runtime by commands like 'pear build' and 'pear install'. Actual result: -------------- The <default> sub-element of the <configureoption> tag is ignored.

Comments

 [2008-01-05 23:33 UTC] jon (Jon Parise)
This actually looks like a problem in PEAR_PackageFileManager. The <configureoption> tag should include the default value as an attribute and not as a child element.
 [2008-01-13 00:39 UTC] jon (Jon Parise)
I stand corrected: the problematic code is in PEAR itself, not PEAR_PackageFileManager. I will attach a patch the addresses this problem.
 [2008-01-18 22:47 UTC] cellog (Greg Beaver)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.