summaryrefslogtreecommitdiff
path: root/libpod/info.go
diff options
context:
space:
mode:
authorAnders F Björklund <anders.f.bjorklund@gmail.com>2021-09-13 22:00:12 +0200
committerMatthew Heon <mheon@redhat.com>2021-09-16 11:00:05 -0400
commit901cf71a6091e2a556a52f89c62ca446dbc5cd06 (patch)
treefa6cee885cd8cafec89f2c0146563ad0d7be770b /libpod/info.go
parent507000a304b34850c358d75af3f6291ed444c8f6 (diff)
downloadpodman-901cf71a6091e2a556a52f89c62ca446dbc5cd06.tar.gz
podman-901cf71a6091e2a556a52f89c62ca446dbc5cd06.tar.bz2
podman-901cf71a6091e2a556a52f89c62ca446dbc5cd06.zip
Show variant and codename of the distribution
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 <anders.f.bjorklund@gmail.com>
Diffstat (limited to 'libpod/info.go')
-rw-r--r--libpod/info.go6
1 files changed, 6 insertions, 0 deletions
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
}