mirror of
https://github.com/containers/podman
synced 2024-10-19 16:54:07 +00:00
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>
This commit is contained in:
parent
2cb011ef2b
commit
6f71fa6d9d
|
@ -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 "
|
||||
|
|
Loading…
Reference in a new issue