I am writing my first Yum plugin, which I hope to use to display some info about the packages to be downloaded on an update or an install. I have successfully gotten the plugin to run and have it all set up properly. My problem is getting a list of packages that will be downloaded before the user accepts or cancels the transaction.
There is a method available in a certain conduit, the one provided to predownload_hook(conduit) and postdownload_hook(conduit), that can be called with conduit.getDownloadPackages() to do exactly what I want. However, both of these hooks are called after the user accepts or declines the transaction. According to the yum Python API docs, getDownloadPackages() is not available anywhere else.
I have asked about this in #yum on Freenode a couple of times but haven't gotten an answer. A solution or any help is greatly appreciated. Have a good one.
You want to use the postresolve_hook(), and walk the transaction list. To see a fairly simple copy and paste example look at the changelog plugin (displays the rpm changelog for everything to be installed/upgraded in the transaction).
How can I use the yum Python module to get a list of packages that will be downloaded before accepting the transaction?