
On 08/31/2011 09:50 PM, Pascal Bleser wrote:
Without the bindings, nobody will use it, and we will never know what funny and interesting ideas people might end up with.
I am more interested into the simple API design than the bindings, but I do believe that once the first is accomplished, the second comes very naturally. Mostly because we have duplicated code between zypper, PK and YaST in order to do this set of "useful" operations. The hardest part IMHO is choosing the granularity z.install("foo") is reading the list of repos, refreshing them, selecting some packages to be installed, and committing. Also, you mention z.what_provides(:capability => "smtp_daemon").each { |p| puts "#{p.name} #{p.version} #{p.repo.name}" } So you are getting an object, but then you install by string. I guess the trick here is to offer them both, and then overload them in the script language as if they where one: C mylib_install_by_capability("apache") mylib_install_solvable(obj) ruby Mylib.install(obj) -> obj.is_a?(Solvable) ? install_solvable(obj) : install_by_capability(obj.to_s) Another tricky part to get right is callbacks :-) -- Duncan Mac-Vicar P. - http://www.suse.com/ SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org