Re: package.xml in custom location
| From: | Tony Bibbs | Date: | Mon, 19 Mar 2007 17:06:51 +0000 |
| Subject: | Re: package.xml in custom location | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-45939@lists.php.net to get a copy of this message | ||
Brett Bieber wrote:
Are you using PEAR_PFM2 to generate the package.xml files? If so, can't you specify the package.xml output directory in your PFM script...? 'outputdirectory'Yes PEAR_PackageFileManager2. That's my point! I *am* using the option 'outputdirectory' and PEAR puts the XML file in that directory fine but it's giving the error I referred to when you run "pear package" on the XML file.
Or is it that you want to keep the package.xml files in your build directory?This is exactly what I'm doing. This is a fairly large project so I'd like to keep all the PEAR build stuff in a common place...this includes most of the buildpackage.php files I have, various PHP scripts to auto discover buildpackage.php files for plugins, package XML files, etc.
The package.xml must be in the root of the app which it is packaging because it is the package manifest for all the files the package contains. Any directory references within the package.xml file must be relative to the package.xml as if it is the root, otherwise the installer would have no idea where to get the files.This is the part I think is a bug. If I give packagedir and outputdirectory and those aren't the same the "pear package" command should use the value for packagedir, not the dirname() of the package XML file.
Maybe as a workaround, temporarily copy the package.xml file to the correct directory, chdir, then pear package, and removed the tmp package.xml copy.That would work. If Greg (or whoever) doesn't think this is a bug or that accommodating this sort of scenario is necessary that is what I will probably have to do.
This concept could be used for a modified/improved 'pear package' command which has a new parameter like pear package -s /path/to/app /path/to/app/build/package.xml which would copy the package.xml file as well as the files referenced in the package.xml using -s as the root to a temp directory containing the correct file structure, where the package tar/tgz would be created then copied back where the pear package call was issued from.Right, there are probaby a few ways to get the desired behavior. I'm flexible, just want to know if this should be considered a bug or not and how best facilitate this sort of thing. --Tony