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
committerAnders F Björklund <anders.f.bjorklund@gmail.com>2021-09-14 17:44:42 +0200
commit38c5f6721f9aa2dc2aea751c2e22afd4d9e370b5 (patch)
treec3e06f6d81c052a6b17262bb4cb73fc92ead449d /libpod/info.go
parent20daae1de93c1a73f454f3f3ba04bba03a348f81 (diff)
downloadpodman-38c5f6721f9aa2dc2aea751c2e22afd4d9e370b5.tar.gz
podman-38c5f6721f9aa2dc2aea751c2e22afd4d9e370b5.tar.bz2
podman-38c5f6721f9aa2dc2aea751c2e22afd4d9e370b5.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
}