[yast-devel] New Repository and Products classes
Hi all, Just as a "side-effect" of FATE#320494[1] I've added two new classes to YaST packages library that can be used to query basic data from repositories (or even enabling/disabling them) in a more object oriented way. For example: repos = Packages::Repository.all repo = Packages::Repository.find(1) repo.products repo.disable! if repo.enabled? I've added only what I needed to implement the FATE, but we could extend it in the future (adding support for packages instead of only products, for example). Regards, Imobach [1] https://trello.com/c/D5TL53ov/508-5-sle-12-sp2-p8-i-feature-320494-disable-i... [2] https://github.com/yast/yast-yast2/blob/master/library/packages/src/lib/ packages/repository.rb [3] https://github.com/yast/yast-yast2/blob/master/library/packages/src/lib/ packages/product.rb -- Imobach González Sosa YaST team at SUSE LINUX GmbH -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Dne 11.5.2016 v 13:45 Imobach González Sosa napsal(a):
Hi all,
Just as a "side-effect" of FATE#320494[1] I've added two new classes to YaST packages library that can be used to query basic data from repositories (or even enabling/disabling them) in a more object oriented way. For example:
repos = Packages::Repository.all repo = Packages::Repository.find(1) repo.products repo.disable! if repo.enabled?
Thanks a lot! This really makes the code much better! Note: The implementation still uses the pkg-bindings as the middle layer between YaST and libzypp. Ideally we should drop that layer and use the native Ruby bindings (ruby-zypp) in the future, but that's not trivial... -- Ladislav Slezák Appliance department / YaST Developer Lihovarská 1060/12 190 00 Prague 9 / Czech Republic tel: +420 284 028 960 lslezak@suse.com SUSE -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (2)
-
Imobach González Sosa
-
Ladislav Slezak