[Rpm-maint] [rpm-software-management/rpm] cmake: move os-release parsing into oci branch (PR #3052)

2024-04-20 Thread Luca Boccassi
os-release parsing is only needed for OCI usage, so move it inside the 
appropriate branch. Saves some operations at build time when not needed, and 
also it is necessary as not all OSes define VERSION_ID (e.g.: Debian Unstable 
and Archlinux)
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * cmake: move os-release parsing into oci branch

-- File Changes --

M tests/CMakeLists.txt (5)

-- Patch Links --

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3052
You are receiving this because you are subscribed to this thread.

Message ID: rpm-software-management/rpm/pull/3...@github.com
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] What's the scope of --root (supposed to be)? (Discussion #2735)

2024-04-20 Thread Sam Morris
I think I've stumbled into this. I was trying to use a public GitHub Actions 
runner to create container images built from the `ubi-micro` images, which 
don't have `dnf` installed within.

I found that `dnf --installroot=... install` failed  because the PGP keys it 
wanted weren't found in the RPM database. If I worked around that problem then 
I found that the the container's RPM database in `/var/lib/rpm` was not being 
updated by DNF. Instead, a new RPM database was created in 
`/home/runner/.rpmdb`! The ultimate cause of both problems was a [a Debian 
patch](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=551669) which defines 
%_dbpath as `~/.rpmdb`.

But this isn't specific to Debian either; the following is run on Fedora 39:

```
$ ctr=$(buildah from registry.access.redhat.com/ubi9/ubi-minimal)

$ mnt=$(buildah mount $ctr)

$ dnf --noplugins --releasever=9 --installroot="$mnt" list --installed | wc -l
0

$ chroot "$mnt" rpm -qa | wc -l
103
```

DNF sees no packages installed with the installroot, because the host 
configuration defines `%_dbpath` as `/usr/lib/sysimage/rpm`, again different 
from how it's defined in the `ubi-micro` container image.

I suppose what I've learned is that you can't really use a host's DNF/rpm to 
install into a chroot if the distro/config differs too much between the host 
and the chroot.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/2735#discussioncomment-9174869
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint