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

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    

 [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.


 [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 by the end of next Sunday (CET). If this was a problem with the 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.