| Store | Cart
Lists » ppm

Re: PROVIDE element in .ppd files

From: Gisle Aas <gis...@ActiveState.com>
21 Aug 2006 17:07:18 -0700
Randy Kobes <ran...@theoryx5.uwinnipeg.ca> writes:

> I've noticed that ActiveState's package.lst file,> containing the ppd information for available> packages, includes the PROVIDE element, which is> a list of all modules the package contains. Is> this something that future versions of ppm clients> will be using, and so those of us making up our> own ppm packages should start including?

PPM4 works better if you do, so I would encourage you to do that.
Some background information:

For PPM4 we have moved away from resolving package dependencies by
trying to match up SOFTPKG{NAME,VERSION} with
DEPENDENCY{NAME,VERSION}.  The main reason is that there is simply no
reliable way to map version labels as found on CPAN to the old style 4
number tuples.  In addition the use of DEPENDENCY require dependencies
to be resolved in terms of packages, which often become wrong as perl
and the content of other packages evolve.

To fix this we introduced the REQUIRE and PROVIDE elements to better
describe how packages relate to each other.  A REQUIRE element
reference a named "feature" that need to be present for this package
to work.  A PROVIDE element express a promise that this package will
implement the named "feature".  The feature names are just arbitray
strings as far as PPM is concerned, but the convention is that strings
containing double colons denote Perl module names.

This allow us to represent the original 'PREREQ_PM' entries from the
Makefile.PL as REQUIRE elements, thus capturing the true dependencies
if other packages set up PROVIDE elements to match.  Only
tranformation needed is some convention for modules that do not
naturally contain double colons.  The convention is simply that we
append '::' to those names, thus

   <REQUIRE NAME="URI::" VERSION="3.03"/>

says that this package require the 'URI' module version 3.03 or better
to be installed.

Run 'perldoc ActivePerl::PPM::PPD' for further information about what
changes we made to the PPD files for PPM4.

If you need to create PPD files that works for both PPM4 and PPM3
clients you will need to include both DEPENDENCY and REQUIRE elements.
PPM4 clients will treat the DEPENDENCY elements as REQUIRE elements
but will then ignore the VERSION attribute.  This works as packages
implicitly provide their SOFTPKG/NAME as a feature.  PPM3 clients will
simply ignore the REQUIRE/PROVIDE elemements.

PPM4 clients will look for a 'package.xml' file when a repo is added.
If found then it will not need individual PPD files for the packages.
The package.xml file is just all SOFTPKG elements for a repo enclosed
in a REPOSITORY element.  Since the PPM3 client will not look for this
file it's a good solution to isolate the PPM4 extensions to this file
and then just generate plain old style PPD files for PPM3 and older
clients to consume.

Regards,
Gisle Aas
ActiveState

Recent Messages in this Thread
Randy Kobes Aug 17, 2006 02:37 pm
Gisle Aas Aug 22, 2006 12:07 am
Randy Kobes Aug 25, 2006 02:08 am
Gisle Aas Aug 25, 2006 02:39 am
Randy Kobes Aug 25, 2006 03:06 am
Gisle Aas Aug 25, 2006 05:31 am
Messages in this thread

Next post: PDL