List Info

Thread: package.xml in custom location




package.xml in custom location
user name
2007-03-19 10:23:24
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.

--Tony

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


Re: package.xml in custom location
user name
2007-03-19 11:00:19
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.

Or is it not that simple?

--Tony

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.
> 
> --Tony
> 

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


Re: package.xml in custom location
user name
2007-03-19 11:58:51
On 3/19/07, Tony Bibbs <tonytonybibbs.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

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


Re: package.xml in custom location
user name
2007-03-19 12:06:51
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

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )