On 08/31/2011 09:50 PM, Pascal Bleser wrote:
I would honestly expect something like this: --->8----------------------------------------------------- z = Zypp(:root => '/')
z.repos.each { |r| puts "#{r.name} = #{r.baseurl}" }
z.install "smplayer" unless z.installed? "smplayer"
z.install( :repo => "packman", :package => "smplayer", :version => ">= 1.0.0" )
z.what_provides(:capability => "smtp_daemon").each { |p| puts "#{p.name} #{p.version} #{p.repo.name}" }
I sat together with Michael during the morning to draft some ideas and learn about the tricks of wrapping the API into something more simple. I have put the initial prototype (does what provides) here: https://github.com/openSUSE/zpm The design we found would allow for one type of iterator for various queries that are completely different in libzypp: like whatprovides or getupdates. This iterator can easily be wrapped in each script language into something like you describe above. The README example works already:
./what_provides apache2 2.2.17-3.1
(queries for http_daemon) Lets see if I find time to add something like getting updates (more complicated, ZYpp can ask for keys on refresh and stuff) and then wrap it in ruby. -- 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