Move GetRedHatRelease() and GetHostDistroName() to common package

The `distro` package is now used for distro definitions supported by
osbuild-composer, not for introspecting the Host system. Move
`GetRedHatRelease()` and `GetHostDistroName()` functions to the `common`
package.
This commit is contained in:
Tomas Hozza 2022-06-02 10:28:50 +02:00 committed by Tom Gundersen
parent 804d4210df
commit c7e5e3c9c2
7 changed files with 85 additions and 80 deletions

View file

@ -5,6 +5,7 @@ import (
"sort"
"strings"
"github.com/osbuild/osbuild-composer/internal/common"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/distro/fedora"
"github.com/osbuild/osbuild-composer/internal/distro/rhel8"
@ -69,7 +70,7 @@ func NewDefault() *Registry {
// If there was an error, then the hostDistroName will be an empty string
// and as a result, the hostDistro will have a nil value when calling New().
// Getting the host distro later using FromHost() will return nil as well.
hostDistroName, hostDistroIsBeta, hostDistroIsStream, _ := distro.GetHostDistroName()
hostDistroName, hostDistroIsBeta, hostDistroIsStream, _ := common.GetHostDistroName()
for _, supportedDistro := range supportedDistros {
distro := supportedDistro.defaultDistro()