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

Bug #5947 Some package-info not handled by PEAR_PackageFile_v2
Submitted: 2005-11-13 11:54 UTC
From: heino at php dot net Assigned: cellog
Status: Closed Package: PEAR
PHP Version: 5.1.0 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2005-11-13 11:54 UTC] heino at php dot net
Description: ------------ PEAR/PackageFile/v2.php -------------------------------------------------------- --- v2.php.orig 2005-11-13 12:40:41.064379088 +0100 +++ v2.php 2005-11-13 12:51:06.699268128 +0100 @@ -827,9 +827,15 @@ function packageInfo($field) { $arr = $this->getArray(true); - if ($field == 'apiversion') { + if ($field == 'state') { + return $arr['stability']['release']; + } + if ($field == 'api-version') { return $arr['version']['api']; } + if ($field == 'api-state') { + return $arr['stability']['api']; + } if (isset($arr['old'][$field])) { if (!is_string($arr['old'][$field])) { return null; -------------------------------------------------------- Test script: --------------- extract from package.xml (v2): <file [...] > <tasks:replace from="@package_version@" to="version" type="package-info" /> <tasks:replace from="@package_state@" to="state" type="package-info" /> <tasks:replace from="@api_version@" to="api-version" type="package-info" /> <tasks:replace from="@api_state@" to="api-state" type="package-info" /> </file> Expected result: ---------------- Replacement of the following four strings: '@package_version@' '@package_state@' '@api-version@' '@api-state@' Actual result: -------------- Replacement of the first string: '@package_version@' Following output on the rest: '[some filename]: invalid package-info replacement: state' '[some filename]: invalid package-info replacement: api-version' '[some filename]: invalid package-info replacement: api-state'

Comments

 [2005-11-13 18:35 UTC] cellog
apiversion is already supported, we will add apistate and state
 [2005-11-13 19:26 UTC] heino at php dot net
Don’t you mean ‘api-version’ and ‘api-state’ ? When using ‘apiversion’ I get a parsing error: “ Error: task <tasks:replace> attribute "to" has the wrong value "apiversion" in file [filename], expecting one of "name, summary, channel, notes, extends, description, release_notes, license, release-license, license-uri, version, api-version, state, api-state, release_date, date, time" Parsing of package.xml from file "package.xml" failed Cannot package, errors in package file “ Kind regards, Heino
 [2005-11-14 14:06 UTC] cellog
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. you're right - there's inconsistency there. Thanks