> When we talk about configuration, what's meant by that? All macro 
> definitions? Because there **only** seems to be an issue with 
> `/etc/rpm/macros.image-language-conf` like things.

Yeah, apologies for the confusion. Even though a lot of RPM "configuration" is 
done through macros, RPM does distinguish between *configuration* and *macros*, 
both of which can be overridden with the `--rcfile` and `--macros` CLI options, 
respectively.

What I meant was *macro* configuration, i.e. `--macros`. That takes a 
colon-separated list of paths and defaults to this (line breaks are mine):

```
/usr/lib/rpm/macros:/usr/lib/rpm/macros.d/macros.*:
/usr/lib/rpm/platform/%{_target}/macros:
/usr/lib/rpm/fileattrs/*.attr:/usr/lib/rpm/redhat/macros:
/etc/rpm/macros.*:
/etc/rpm/macros:
/etc/rpm/%{_target}/macros:
~/.rpmmacros
```

That's why I said you'd need to supply all the desired files yourself when 
using this CLI option as there's no way to just prepend/append paths to it.

> As you asked for ideas; I think there's a space for a low-level, 
> distro-specific, rpm-sub-package that would install the distro-specific 
> configuration. If there was such an RPM, Mock could just simply tell DNF to 
> ignore the host's configuration at the beginning (split the preparation into 
> two steps):
> 
> ```
> $ rootdir=$(mktemp -d)
> dnf5 --installroot "$rootdir" install rpm-config --use-host-config
> dnf5 --installroot "$rootdir" install @buildsys-build
> ```

This is mixing two separate issues. The one originally discussed here is about 
RPM respecting the config/macro files in the target root when called with 
`--root`. Populating the root with the desired configuration is a then a 
separate matter and one that would need to be discussed on `fedora-devel` or 
similar channels.

Out of curiosity, though, does the second `dnf5` command *already* work the way 
you want, or was that just your proposal for how it *could* work? If DNF 
already works this way, that means it *does* perform some kind of RPM isolation 
by itself (by calling RPM in a chroot/namespace) and thus adding an option like 
`--use-installroot-config` to DNF should be fairly easy.

> 
> The first transaction needs to be as small as possible. Small enough to let 
> distro-maintainers cure the target distribution so the transaction **isn't 
> affected** by the **host** configuration at all. The second transaction, 
> since the config is already **in chroot**, can ignore the host configuration 
> entirely.
> 
> Seems like the set of packages in the first transaction in Fedora is 
> currently pretty small:
> 
> ```
> $ sudo dnf5 --installroot "$rootdir" install setup --use-host-config
> Updating and loading repositories:
> Repositories loaded.
> Package                        Arch     Version       Repository      Size
> Installing:
>  setup                         noarch   2.14.4-1.fc39 fedora     720.3 KiB
> Installing dependencies:
>  fedora-gpg-keys               noarch   39-1          fedora     123.2 KiB
>  fedora-release                noarch   39-30         fedora       0.0   B
>  fedora-release-common         noarch   39-30         fedora      17.7 KiB
>  fedora-release-identity-basic noarch   39-30         fedora     666.0   B
>  fedora-repos                  noarch   39-1          fedora       4.5 KiB
>  filesystem                    x86_64   3.18-6.fc39   fedora     106.0   B
> 
> Transaction Summary:
>  Installing:        7 packages
> 
> Total size of inbound packages is 1 MiB. Need to download 1 MiB.
> After this operation 867 KiB will be used (install 867 KiB, remove 0 B).
> Is this ok [y/N]:
> ```
> 
> Not sure if one of those could be recycled for this purpose, instead of 
> creating a new `rpm-config` package?

Again, while possibly a valid proposal, this is not the right venue for 
discussing it, it needs to be brought up on the Fedora channels.



-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2623#issuecomment-1777409514
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/2623/1777409...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to