aboutsummaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorAnders F Björklund <anders.f.bjorklund@gmail.com>2022-02-24 20:23:00 +0100
committerAnders F Björklund <anders.f.bjorklund@gmail.com>2022-02-24 20:24:31 +0100
commit6f71fa6d9dc82a42cc3823247bd0aed0ea138162 (patch)
tree5b96a4bf5970d85c9f45c6e4e4e931fea3dac46e /libpod
parent2cb011ef2b17adbc7b1de1db4861f6e3eaa24025 (diff)
downloadpodman-6f71fa6d9dc82a42cc3823247bd0aed0ea138162.tar.gz
podman-6f71fa6d9dc82a42cc3823247bd0aed0ea138162.tar.bz2
podman-6f71fa6d9dc82a42cc3823247bd0aed0ea138162.zip
Show version of the deb package in info output
Previously just showing name of the package, followed by the path repeated again (already stated on the line above) [NO NEW TESTS NEEDED] Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/util.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/util.go b/libpod/util.go
index 307caa8c5..51fe60427 100644
--- a/libpod/util.go
+++ b/libpod/util.go
@@ -149,6 +149,14 @@ func queryPackageVersion(cmdArg ...string) string {
cmd := exec.Command(cmdArg[0], cmdArg[1:]...)
if outp, err := cmd.Output(); err == nil {
output = string(outp)
+ if cmdArg[0] == "/usr/bin/dpkg" {
+ r := strings.Split(output, ": ")
+ queryFormat := `${Package}_${Version}_${Architecture}`
+ cmd = exec.Command("/usr/bin/dpkg-query", "-f", queryFormat, "-W", r[0])
+ if outp, err := cmd.Output(); err == nil {
+ output = string(outp)
+ }
+ }
}
if cmdArg[0] == "/sbin/apk" {
prefix := cmdArg[len(cmdArg)-1] + " is owned by "