Skip to content

Commit

Permalink
Add support for Gentoo file to package query
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jubalh committed Dec 29, 2020
1 parent 9c9f02a commit 904dec2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libpod/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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) {
Expand Down

0 comments on commit 904dec2

Please sign in to comment.