| Store | Cart
Lists » ppm

Re: PROVIDE element in .ppd files

From: Randy Kobes <ran...@theoryx5.uwinnipeg.ca>
Thu, 24 Aug 2006 21:08:41 -0500 (CDT)
On Mon, 21 Aug 2006, Gisle Aas wrote:

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

Thanks very much for that - that, especially concerning
the dependencies, sounds like a more flexible system
(and easier to generate from the Makefile.PL :)

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

I'll start looking into doing that with PPM-Make, which
is what I use to generate the ppm packages. I have
one question concerning what's currently happening
with the ActiveState packages. As an example,
the ACH-Generator package found at
    http://ppm.activestate.com/PPMPackages/5.8-windows/
(which I take it is used by ppm3) consists, as you
suggest, the extra PROVIDE element:

<SOFTPKG NAME="ACH-Generator" VERSION="0,01,0,0">
<ABSTRACT>
Generates an ACH formatted file from an ACH perl object
</ABSTRACT>
<AUTHOR>Christopher Kois (cpk...@cpan.org)</AUTHOR>
<IMPLEMENTATION>
<ARCHITECTURE NAME="MSWin32-x86-multi-thread-5.8"/>
<CODEBASE
HREF="MSWin32-x86-multi-thread-5.8/ACH-Generator-0.01.tar.gz"/>
<DEPENDENCY NAME="ACH" VERSION="0,01,0,0"/>
<OS NAME="MSWin32"/>
<PROVIDE NAME="ACH::Generator" VERSION="0.01"/>
</IMPLEMENTATION>
<TITLE>ACH-Generator</TITLE>
</SOFTPKG>

The corresponding entry in the package.xml file
at the same location reads

<SOFTPKG NAME="ACH-Generator" VERSION="0.01">
<ABSTRACT>
Generates an ACH formatted file from an ACH perl object
</ABSTRACT>
<AUTHOR>Christopher Kois (cpk...@cpan.org)</AUTHOR>
<IMPLEMENTATION>
<ARCHITECTURE NAME="MSWin32-x86-multi-thread-5.8" />
<CODEBASE
HREF="MSWin32-x86-multi-thread-5.8/ACH-Generator-0.01.tar.gz">
</CODEBASE>
</IMPLEMENTATION>
<PROVIDE NAME="ACH::Generator" VERSION="0.01" />
<REQUIRE NAME="ACH" />
</SOFTPKG>

I see that the ppm4 REQUIRE element specifies the
distribution name (as does the ppm3 DEPENDENCY
element), rather than the module name that appears
in the PROVIDE element - I suppose one reason
for this is for compatibility with ppm3 ppm
packages that don't have any PROVIDEs? Will this
be done for the foreseeable future?

Also, I was wondering why the REQUIRE element doesn't
have a VERSION attribute (from what I understand,
ppm4 will use this). Does this mean requiring
a package will default to getting any available
version? Would putting in a VERSION in REQUIRE
be used by ppm4 in demanding a minimum version
(as the ppm3 DEPENDENCY currently does)?

Thanks again.

-- 
best regards,
Randy

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

Previous post: Re: PDL