dnf-json: avoid randomizing package order
We want depsolving via dnf-json, followed by rpm installation to be the same as installing directly with dnf. However, the `install_set()` helper we used inserts the list of packgaes into a set internally before returning it to us to iterate. Set order iteration is not a FIFO in python, and because the order of package installation in rpm is only a partial order, we ended up with different images depending on whether we installed through dnf or dircetly via rpm. To avoid the indirection via a set, open-code `install_set()` without the intermediate allocation. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
1ce84a5eff
commit
0b3d2be698
1 changed files with 6 additions and 1 deletions
7
dnf-json
7
dnf-json
|
|
@ -129,7 +129,12 @@ with tempfile.TemporaryDirectory() as persistdir:
|
|||
exit_with_dnf_error("DepsolveError", f"There was a problem depsolving {arguments['package-specs']}: {e}")
|
||||
|
||||
dependencies = []
|
||||
for package in base.transaction.install_set:
|
||||
for tsi in base.transaction:
|
||||
# avoid using the install_set() helper, as it does not guarantee a stable order
|
||||
if tsi.action not in dnf.transaction.FORWARD_ACTIONS:
|
||||
continue
|
||||
package = tsi.pkg
|
||||
|
||||
dependencies.append({
|
||||
"name": package.name,
|
||||
"epoch": package.epoch,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue