[Pkg-rpm-devel] Bug#794495: Mock fails to track installed packages

Michal Čihař michal at cihar.com
Wed Nov 8 10:10:39 UTC 2017


Hi

On Tue, 2017-04-18 at 14:12 +0200, Tzafrir Cohen wrote:
> This is a Debian-specific change in the package rpm. RPM
> automatically
> attempts to create its database if it does not exist. On Debian it
> does
> not exist. This creates a harmless but noisy and annoying error
> message
> whenever you try to use rpm on the Debian system.
> 
> Why would you use rpm on a Debian system?
> 
> * rpm -qp: annoying message
> * rpm operations as root inside an RPM-based system in a chroot: that
>   fix breaks it.

Can't you just edit the file when constructing chroot? Or am I missing
something here?

> I can't think of any way to fix this in mock or in yum. I think that
> the
> proper way to fix it is in rpm: instead of editing _dbpath, don't
> complain when you get EPERM trying to open the packages database. A
> patch is attached (against 4.12.0.2, as it seems that patches fail to
> apply for 4.13.0.1 in master).

With your patch it still does complain, what would make the most usual
use case for rpm (alien) pretty annoying:

$ fakeroot alien blacs-doc-1.1-1.2.x86_64.rpm 
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
blacs-doc_1.1-2.2_amd64.deb generated

I don't think this is acceptable.

> I did not look deeper into it. Maybe it's possible to avoid opening
> the
> database on rpm -qp?

AFAIK it was not possible as it at least tries to open the keys
database to verify signatures (which usually doesn't exist on Debian).

I'm open to better solutions, but they can not break existing
workflows.

-- 
	Michal Čihař | https://cihar.com/ | https://weblate.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-rpm-devel/attachments/20171108/81dd871c/attachment-0001.sig>


More information about the Pkg-rpm-devel mailing list