On 16/05/2009, at 14:31, Daniel Macks wrote: > On Sat, May 16, 2009 at 12:48:42PM -0400, Benjamin Reed wrote: >> On 5/16/09 12:07 PM, Monic Polynomial wrote: >>> I'm developing a Fink notification plugin and I need to parse the >>> list >>> of package names that the plugin receives from Fink. >>> Fink::PkgVersion::phase_activate() sends a notification whose >>> description contains the packages formatted as >>> Fink::PkgVersion::get_fullname(), the same as %f. >> >> Generally you'll use Fink::Package's get_matching_versions: >> >> get_matching_versions >> my @pvs = $po?>get_matching_versions($spec); >> my @pvs = $po?>get_matching_versions($spec, >> @choose_from); >> >> Find all versions of this package which satisfy the given >> Debian version specification. See >> Fink::Services::version_cmp for details on version >> specifications. > > I think that would handle dependency formats ("foo (>= 1.0-2)") not > %f. Maybe Engine::expand_packages? I think that's what processes the > packages specified on fink commandline.
Fink::Engine::expand_packages() did the trick - it calls Fink::PkgVersion::match_package(), which plays with the various possibilities of splitting the fullname using '-' as a field separator until it finds a package name known by Fink (recall that both the name and the version may contain '-'). Cheers, -- monipol ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Fink-devel mailing list Fink-devel@lists.sourceforge.net http://news.gmane.org/gmane.os.apple.fink.devel