Re: package.xml in custom location
| From: | Brett Bieber | Date: | Mon, 19 Mar 2007 16:58:51 +0000 |
| Subject: | Re: package.xml in custom location | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-45938@lists.php.net to get a copy of this message | ||
On 3/19/07, Tony Bibbs <tony@tonybibbs.com> wrote:
Worth noting I just tried to add a chdir() call to my .php script that
runs all my "pear package" calls and that doesn't do the trick either.
Seems to me if you can successfully build the .xml to a custom output
directory it should be able to build itself using the path information
from the package xml. Instead it is using dirname() of the package.xml
instead:
Validator.php:1635
if (!file_exists($dir_prefix . DIRECTORY_SEPARATOR . $package)) {
$this->_fileNotFound($dir_prefix . DIRECTORY_SEPARATOR . $package);
$this->_isValid = 0;
continue;
}
where $dir_prefix is:
$dir_prefix = dirname($this->_pf->_packageFile);
Should it not be possible to run "pear package" on a package xml file in
a location outside of the root of the package? I mean I explicitly set
'packagedirectory' in my setOptions() call. If that can be agreed upon,
I have no problem submitting a patch to do just that.
Tony Bibbs wrote: My project has a /path/to/app/build directory where I have all my package*.xml files in it. I have a script in that same directory that runs the "pear package" command on each .xml it finds. Problem is the .xml scripts seem to expect that the "pear package" be issued from the /path/to/app directory as I get a bunch of these sorts of errors: Error: File ".\plugins/calendar/config.php" in package.xml does not exist The error makes sense as the /plugins directory is not in /path/to/app/build, it's in /path/to/app. Is there a way around this? I like keeping all my PEAR build stuff in the /build directory if possible.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' You'll be able to keep your build scripts in the build directory, but output the package.xml in the directory where it needs to be. Or is it that you want to keep the package.xml files in your build directory? Because the package validator only uses the package.xml file to check the package's validity, a different source path for the files doesn't make any sense. 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. 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. 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. -- -Brett Bieber http:saltybeagle.com aim:ianswerq