diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-12-29 20:29:35 +0100 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-12-29 20:33:27 +0100 |
commit | 904dec2164bee3d5276fe061c779fedebe6515af (patch) | |
tree | c2d208e717161a9430a396df3742fe17cc87ca7d /libpod | |
parent | 9c9f02aad773051fa742a874844f08f2fb567d3b (diff) | |
download | podman-904dec2164bee3d5276fe061c779fedebe6515af.tar.gz podman-904dec2164bee3d5276fe061c779fedebe6515af.tar.bz2 podman-904dec2164bee3d5276fe061c779fedebe6515af.zip |
Add support for Gentoo file to package query
On Gentoo systems where `app-portage/gentoolkit` is installed the binary
`equery` is used to query for information on which package a file
belongs to.
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/util.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libpod/util.go b/libpod/util.go index 8faf665e7..bf9bf2542 100644 --- a/libpod/util.go +++ b/libpod/util.go @@ -153,6 +153,10 @@ func queryPackageVersion(cmdArg ...string) string { return strings.Trim(output, "\n") } +func equeryVersion(path string) string { + return queryPackageVersion("/usr/bin/equery", "b", path) +} + func pacmanVersion(path string) string { return queryPackageVersion("/usr/bin/pacman", "-Qo", path) } @@ -172,7 +176,10 @@ func packageVersion(program string) string { if out := dpkgVersion(program); out != unknownPackage { return out } - return pacmanVersion(program) + if out := pacmanVersion(program); out != unknownPackage { + return out + } + return equeryVersion(program) } func programVersion(mountProgram string) (string, error) { |