Subject: Re: Changes to use new PEAR features (channels and package.xml v2)
To: None <>
From: Christopher W. Richardson <>
List: tech-pkg
Date: 06/27/2007 10:15:09
Hash: SHA1


I've played around with this a little more, and it appears that
fixing things so that the *.reg file is properly in the PLIST
fixes my second issue -- but that still leaves the first one: 

"Christopher W. Richardson" <> writes:

> First, for channels, there are already a number of them out
> there, and I'm sure the list is only going to grow (q.v.,
>  Off the top of my head, there
> are at least three ways to handle this:
> 	a) add "meta" packages for each channel, and use those
> 	   packages as dependencies for any pear packages from
> 	   the channels
> 	b) add logic in lang/php/ to properly handle
> 	   channels (adding some sort of CHANNEL variable, and
> 	   doing pre-install and post-deinstall work to attempt
> 	   to register or unregister the channel from pear)
>       c) let each package handle channel issues on its own
> Anyone have any thoughts/preferences/other suggestions on the
> above?

I've managed to get around the second issue by patching

cwr@ns$cvs diff pear_plist.php
Index: pear_plist.php
RCS file: /cvsroot/pkgsrc/lang/php/pear_plist.php,v
retrieving revision 1.4
diff -r1.4 pear_plist.php
< if (!empty($info['attribs']) && $info['attribs']['version'] ==
<       $pkg = $info['name'];
< else
<       $pkg = $info['package'];
- ---
> #
> # Read in package.xml using new API, and extract channel
> information
> $z = &PEAR_Config::singleton();
> $package = new PEAR_PackageFile($z);
> $pf = $package->fromAnyFile("$WRKSRC/package.xml",
> $version = $pf->getPackagexmlVersion();
> #
> # Use new method to get package name and channel info
> if ($version == '1.0')
>         $pkg_name = $pf['name'];
> else {
>         $pkg = $pf->_packageInfo['name'];
>         $channel = $pf->_packageInfo['channel'];
> }
< echo "$PEAR_LIB/.registry/".strtolower($pkg).".reg\n";
- ---
> if (($version == '1.0') || ($channel == ''))
>         echo "$PEAR_LIB/.registry/".strtolower($pkg).".reg\n";
> else
>         echo "$PEAR_LIB/.registry/.channel." . $channel . "/" .
>             strtolower($pkg) . ".reg\n";

I haven't tested the above with a bunch of other pear packages,
so if someone could check that, that would be great.  But, as you
can see, it digs the channel out of the package.xml file.  I'm
still stuck manually doing a "pear channel-discover foo".

- From a, b, and c above, I don't think c makes sense.  The
question then is, from a pkgsrc paradigm perspective, does it
make more sense to extend or to add meta-packages?  The
advantage to doing the latter is that it could take advantage of
the PLIST magic for handling conditional deletion of files (if
multiple packages are using them); the disadvantage is that it's
providing only a minimal amount of functionality, and may end up
adding many packages (there are currently a dozen channels listed
at and I only expect that list to
go).  Like I said before, I'm willing to work on this -- but, at
this point, I'd like some guidance from the team before I go down
the wrong path.


Version: GnuPG v1.4.7 (NetBSD)
Comment: Processed by Mailcrypt 3.5.8 <>