Hi,
I've finally had a chance to get back to this. Thanks for your comments
and suggestions by private mail. For those reading along:
I upgraded the dh-make-php package to the lenny version (0.2.0->0.2.10),
and tried running '/usr/share/dh-make-php/phppkginfo . oci8' manually.
This did nothing and gave no output.
On Sat, 22 Mar 2008, Uwe Steinmann wrote:
Looks like /usr/share/dh-make-php/phppkginfo fails to read
the package.xml file propperly.
This is correct, sort of. It's not opening the package.xml file.
Try to run it manually. Unpack the oci-1.2.4.tar.gz file and
run '/usr/share/dh-make-php/phppkginfo . version'
in that directory. Actually, it would be sufficient if the
current directory contains the package.xml file.
This fails. It fails because phppkginfo takes the first argument and
passes it to the method ->fromAnyFile in the PEAR_PackageFile.
Looking at the code (/usr/share/php/PEAR/PackageFile.php), this method
expects a _file_ and throws an error if it does not get one.
However phppkginfo does not check the return status of the fromAnyFile
method call.
excerpt from phppkginfo --------------------------------------------
...
$pkg = new PEAR_PackageFile($config);
$pf = $pkg->fromAnyFile($_SERVER["argv"][1], PEAR_VALIDATE_NORMAL);
...
if (get_class($pf) == "PEAR_PackageFile_v1") {
...
excerpt from PackageFile.php----------------------------------------
...
function &fromAnyFile($info, $state)
{
if (is_dir($info)) {
$info = PEAR::raiseError("'$info' is a directory, a file
is expected");
return $info;
}
...
If I run '/usr/share/dh-make-php/phppkginfo ./package.xml version'
I get '1.2.4' returned, which is the correct value.
> > What is /usr/bin/php? Is it php4 or php5?
> php5, I think, as I explicitly installed php5-dev;
> apt-get install dh-make-php php5-dev
That wont be enough. You need php5-cli.
I installed version 5.2.0-8+etch10 (latest etch version)
So the problems here seem to be:
1. phppkginfo is calling PEAR_PackageFile->fromAnyFile with an incorrect
argument (a directory instead of a file)
OR
the Usage information in phppkginfo is incorrect, and it should stipulate
a file name be supplied instead of a directory name.
2. (related to the lack of output)
phppkginfo does not check for errors raised by the fromAnyFile call
3. (related to the lack of output)
phppkginfo does not complain if get_class($pf) returns anything other
than the expected values PEAR_PackageFile_v{1,2}.
This could be handled with a simple final else { } .
Perhaps it is intended phppkginfo should fail silently, I don't know.
Version checks: in the comments above I am referring to
/usr/share/php/PEAR/PackageFile.php from php-pear 5.2.0-8+etch10
/usr/share/dh-make-php/phppkginfo from dh-make-php 0.2.10.
The file /usr/share/dh-make-php/phppkginfo does not exist in the etch
version (0.2.0) of dh-make-php.
If I go look at version 5.2.3-1+lenny1 of php-pear, I find that the
fromAnyFile method has been significantly reworked and that I can
now get the source package tree (php-oci8-1.2.4) from running
'dh-make-pecl oci8'. I was unable to build a binary package from
this source package, but more of that later.
Summary
-------
The above suggests dh-make-php should have a versioned dependency on
php-pear, since in this case a program in 0.2.10 fails silently when used
with php-pear version 5.2.0-8+etch10, but apparently works with 5.2.5-3.
Does that sound right to you?
Perhaps you could also address problem 3) above, if it is not intended
that the phppkginfo program should fail silently on an unexpected value
from get_class($pf).
These points are both off-topic from the original bug, (which I will go
back to working on now); should this bug be cloned to handle the other
issues?
Cheers
Vince
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]