From 38c5f6721f9aa2dc2aea751c2e22afd4d9e370b5 Mon Sep 17 00:00:00 2001 From: Anders F Björklund Date: Mon, 13 Sep 2021 22:00:12 +0200 Subject: Show variant and codename of the distribution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Along with the name (id) and the version(_id) But only show the information if is available Examples: Fedora CoreOS, Ubuntu Focal [NO TESTS NEEDED] Signed-off-by: Anders F Björklund --- libpod/info.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libpod/info.go') diff --git a/libpod/info.go b/libpod/info.go index 31ec9cdc1..2eba4bbff 100644 --- a/libpod/info.go +++ b/libpod/info.go @@ -370,9 +370,15 @@ func (r *Runtime) GetHostDistributionInfo() define.DistributionInfo { if strings.HasPrefix(l.Text(), "ID=") { dist.Distribution = strings.TrimPrefix(l.Text(), "ID=") } + if strings.HasPrefix(l.Text(), "VARIANT_ID=") { + dist.Variant = strings.Trim(strings.TrimPrefix(l.Text(), "VARIANT_ID="), "\"") + } if strings.HasPrefix(l.Text(), "VERSION_ID=") { dist.Version = strings.Trim(strings.TrimPrefix(l.Text(), "VERSION_ID="), "\"") } + if strings.HasPrefix(l.Text(), "VERSION_CODENAME=") { + dist.Codename = strings.Trim(strings.TrimPrefix(l.Text(), "VERSION_CODENAME="), "\"") + } } return dist } -- cgit v1.2.3-54-g00ecf