[zypp-devel] new workflow / libzypp-bindings
Hi! I successfully compiled the libzypp-bindings now. As stated in a previous mail, the examples are outdated. I'm no trying to fix it, but got stuck: E.g.: list-available-resolvables.py bails out at Z.addResolvables(...) I started coding a bit about my use-case: Read repo from local server, display installable items. Its much like the list-available-resolvables.py - just a remote-repo. It should look like: import zypp Z = zypp.ZYppFactory_instance().getZYpp() repoManager = zypp.RepoManager() #possibly set PATH to some /tmp/foo (won't touch installed system!) # myurl1 = zypp.Url("http://192.168.10.247/home:/user/standard/") # right ? repo1 = repoManager.addRepository(?????) # hmm syntax inside () ??? repo2 = repo3 = repos = repoManager.knownRepositories() for repo in repos: if not repo.enabled() continue if not repo.isCached(repo): repoManager.buildCache(repo) # # substitute for Z.addResolvables() !! print "Available" # ... and so on Any help appreciated! Best regards Jan-Simon -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Jan-Simon Möller wrote:
# # substitute for Z.addResolvables() !!
print "Available" # ... and so on
In 11.0 the replacement for the 10.3 addResolvables() is RepoManager::loadFromCache() which gets passed the RepoInfo you constructed yourself or you got from RepoManager::knownRepositories (which reads from repos.d ) For installed packages: ZYpp::Ptr z = getZYpp(); z->initializeTarget("/"); z->target()->load(); (this caches the rpmdb on a solv file, if needed and loads it ) You can also do the same as a lower level, by adding a solv file manually (this is useful for testsuites or testcases) sat::Pool::instance().addRepoSolv("foo.solv", "name"); In this case, the objects will be added as installed if name == @System. Duncan -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (2)
-
Duncan Mac-Vicar Prett
-
Jan-Simon Möller