I’ve finally pushed some code that I’ve ended up working on in two different hemispheres!
With the putback of:
changeset: 1933:5193ac03ad9f tag: tip user: Tim Foster date: Tue Jun 08 12:17:06 2010 +1200 description: 15305 need to generate dependency information from SMF manifests 15306 need an attribute to declare the SMF services a package delivers 15722 pkgdepend doesn't always remove internal deps when variants taken into account
pkgdepend(1) will now use SMF manifests as a source for dependency information.
This means, that if you as a package author are including SMF manifests in your package, the package publishing system will look in those manifests for any service descriptions that declare other FMRIs as “require_all” dependencies for your service, and will then ensure that the packages delivering those services are marked as dependencies for the package you’re publishing.
Obviously to do this work, pkgdepend needs to be run on a build machine that includes all SMF FMRIs that your package needs to function. That said, having your publishing system figure out dependencies for you, means there’s one less thing for you as a publisher to worry about, and certainly will make life easier for your users.
An interesting side-effect of this work, is that now you’ll be able to search the package database for SMF manifest FMRIs. For example, if you’re wondering who delivers svc:/network/iptun:default, you can do a simple search for it -
$ svcs iptun STATE STIME FMRI online May_27 svc:/network/iptun:default $ pkg search -l ':::svc\:/network/iptun\:default' INDEX ACTION VALUE PACKAGE opensolaris.smf.fmri set svc:/network/iptun:default pkg:/SUNWcs@0.5.11-0.142
(though do remember to escape the colons in the SMF FMRI field. Wildcards also work, so for kicks, you might want to try pkg search -l ':::svc\:* :-)
Enjoy!

Tim Foster said:
I’d also like to express thanks to everyone on the pkg(5) team and associates who reviewed my code, pointed out problems, or otherwise helped ease my post-putback anxiety. I’ll be calmer once the ON build machines are running these bits :-)
John Levon said:
This is very cool… on a slightly related question, why is the pkg search syntax so obscure? Shouldn’t “pkg search iptun” just work?
timsfoster said:
Thanks! As for the search syntax, it’s because we’re not tokenising ‘set’ action values in the same as we do for ‘file’ actions ( see http://src.opensolaris.org/source/xref/pkg/gate/src/modules/actions/file.py#433 ) since ‘set’ action values can contain any string, not just paths or SMF FMRIs, we need to use the richer colon-separated search syntax explained in the man page.
We could hack around this by tokenising the SMF FMRI up-front, and adding those to the set action value, but it’d be a lot more metadata going into the package.
Better would be write code that could perform different tokenisation of ‘set’ action values based on the ‘set’ attribute names – in which case, we could do this at index-generation time, rather than the hack above. I’ll ask around to see if this idea would fly.
Pingback: Tweets that mention pkg(5) SMF manifest dependency support « Tim Foster's Web Log -- Topsy.com
Pingback: pkgdepend improvements « Tim Foster's Web Log
Pingback: The IPS System Repository « Tim Foster's Web Log