Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Trying to rewrite to use libdnf5 #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

bcl
Copy link
Owner

@bcl bcl commented Sep 27, 2022

It appears there is no direct variable assignment available. You have to use .set() and .get_value() which makes this really awkward.

When using .set() it needs a priority, with RUNTIME having the highest precedence. Otherwise the new config setting won't take effect.

Managed to get it to download metadata and show the NEVRA of the packages selected on the cmdline.

It seems to run the transaction -- goal.resolve() takes a long time and the CPU is busy.

But I cannot figure out how to do anything with the transaction. It returns a memory leak error and I cannot iterate the result.

(Pdb) trx.get_transaction_packages()
<Swig Object of type 'std::vector< libdnf::base::TransactionPackage,std::allocator< libdnf::base::TransactionPackage > > *' at 0x7f5b257d83c0> swig/python detected a memory leak of type 'std::vector< libdnf::base::TransactionPackage,std::allocator< libdnf::base::TransactionPackage > > *', no destructor found.

It appears there is no direct variable assignment available. You have to
use .set() and .get_value() which makes this really awkward.

When using .set() it needs a priority, with RUNTIME having the highest
precedence. Otherwise the new config setting won't take effect.

Managed to get it to download metadata and show the NEVRA of the
packages selected on the cmdline.

It seems to run the transaction -- goal.resolve() takes a long time
and the CPU is busy.

But I cannot figure out how to do anything with the transaction.
It returns a memory leak error and I cannot iterate the result.

(Pdb) trx.get_transaction_packages()
<Swig Object of type 'std::vector< libdnf::base::TransactionPackage,std::allocator< libdnf::base::TransactionPackage > > *' at 0x7f5b257d83c0>
swig/python detected a memory leak of type 'std::vector< libdnf::base::TransactionPackage,std::allocator< libdnf::base::TransactionPackage > > *', no destructor found.
Ends up you need to call sack.create_repos_from_reposdir() to load the
repo files copied into the temporary reposdir. And find needed to be
rewritten to use the new API.

Previous issues were due to missing swig bindings for python. Fixed
in commit e6631ceb50ba69b475f4edc1e6be7b416544d430 from the dnf5 repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant