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

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  
Comments Add Comment Add patch


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 : 45 + 36 = ?

 
 [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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!