[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#913683: apt: Please add support for package file lists API via libdpkg-dev



On Wed, Nov 14, 2018 at 02:46:33AM +0100, Guillem Jover wrote:
> Source: apt
> Source-Version: 1.8.0~alpha2
> Severity: wishlist
> User: debian-dpkg@lists.debian.org
> Usertags: dpkg-db-access-interface
> 
> Hi!
> 
> The dpkg database will be changing formats in the near future, and one
> of the blockers is all the code accessing it directly w/o going via a
> supported interface. These include packages already using libapt, and
> others using python-apt. So adding an interface in libapt would make
> it possible for python-apt to do the same, and all their users to use
> that properly.
> 
> A supported interface can be libdpkg-dev, which recently got support
> for the file database, moved from the core dpkg code. Even though the
> library is a static one, it should be built as PIC to support PIE
> nowadays, so that should make it linkable for libapt. And even though
> using a static library with a volatile API is not desirable, it's
> probably better than any of the alternatives.

So, I had a look at the API, and it does not seem usable at the
moment. We need an API that we can hook into our error system:

(1) A way to get the result of a function call, and an error message, if any;
    for example, by making functions return booleans, and ohshit{,e} _somehow_
    calling _error->Error by us providing a custom hook.
(2) A way for warnings to be converted to _error->Warning()

libdpkg as is basically just crashes the application, which is not
a correct thing to do for a library.


-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en


Reply to: