debian-forge-composer/internal/distro
Tomas Hozza fba9fe1072 Make the Distroregistry FromHost() return distro with correct name
Composer does not have 1:1 mapping of what can be the Host Distro name
and the names of supported distributions held in the Distroregistry.

The fact that the host distro `Name()` method as passed to the Weldr API
does not return the same name as what is used as distro name for
repository definitions. This makes it hard to use `distro.Distro` and
`distro.Arch` directly and rely on the values returned by them as their
name.

Add `New*HostDistro()` to all distro definitions, accepting the name
that should be returned by the distro's `Name()` method. This is useful
mainly if the host distro is Beta or Stream variant of the distro.

Change the distroregistry.Registry to contain host distro as a separate
value set when creating it using `New()` function. This value is
returned by `Registry.FromHost()` method. Determining the host distro is
handled by the `NewDefault()` function. Move the distro name mangling to
distroregistry package. Add relevant unit tests.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-05-14 15:43:00 +02:00
..
distro_test_common distro/test: use the new default distroregistry 2021-03-12 08:29:30 +01:00
fedora32 Make the Distroregistry FromHost() return distro with correct name 2021-05-14 15:43:00 +02:00
fedora33 Make the Distroregistry FromHost() return distro with correct name 2021-05-14 15:43:00 +02:00
rhel8 Make the Distroregistry FromHost() return distro with correct name 2021-05-14 15:43:00 +02:00
rhel84 Make the Distroregistry FromHost() return distro with correct name 2021-05-14 15:43:00 +02:00
rhel85 Make the Distroregistry FromHost() return distro with correct name 2021-05-14 15:43:00 +02:00
rhel90 Make the Distroregistry FromHost() return distro with correct name 2021-05-14 15:43:00 +02:00
test_distro Extend the "Test Distro" definition and modify affected tests 2021-05-14 15:43:00 +02:00
distro.go distro: add URL to OSTreeImageOptions 2021-03-17 18:12:17 +00:00
distro_test.go distro/test: use the new default distroregistry 2021-03-12 08:29:30 +01:00
osrelease_test.go distro: add DetectHost 2019-11-10 17:23:14 +01:00