PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PEAR » PEAR » Bug #5947

Some package-info not handled by PEAR_PackageFile_v2

Details

Submitted2005-11-13 11:54 UTC
Fromheino at php dot net
Assignedcellog
StatusClosed
PackagePEAR
PHP Version5.1.0
Roadmaps(Not assigned)

Comments

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

[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