[Rpm-maint] [rpm-software-management/rpm] Drop special handling of implicit database open in Python (#1647)

Panu Matilainen notifications at github.com
Mon Apr 19 12:03:54 UTC 2021


Let rpmtsInitIterator() and rpmtsInitIndexIterator() handle the implicit database open behind the scenes if necessary, doubling the logic up in Python side only gets in the way of improving things. As an additional side-effect, this makes the implicit open from Python bindings honor the database mode in the transaction set.

This loses the ability to differentiate between database open failure and "not found" from the iterator init, but this is intentional: if you care about database open result, open it explicitly by yourself. If you don't, then a non-existent database is for most practical purposes just a special case of "not found", which is what 99% of Python users assume and dont bother to test for exceptions anyway.
    
This is the second half of restoring yum/dnf functionality on empty chroot install since losing implicit database creation.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/1647

-- Commit Summary --

  * Add rpmtsInitIterator() analogue for index iterators
  * Drop special handling of implicit database open in Python

-- File Changes --

    M lib/rpmts.c (27)
    M lib/rpmts.h (9)
    M python/rpmts-py.c (21)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1647.patch
https://github.com/rpm-software-management/rpm/pull/1647.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1647
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210419/2bb26d18/attachment.html>


More information about the Rpm-maint mailing list