Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit ebfacbe

Browse files
committed
Search for Python version also in /usr/lib/python
Path to Python is different on deb-based distributions and rpm-based distributions (e.g. Fedora, CentOS).
1 parent 3d6d468 commit ebfacbe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

differs/pip_diff.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ func getPythonVersion(pathToLayer string) ([]string, error) {
129129
return matches, err
130130
}
131131

132-
for _, file := range libContents {
132+
libPath = filepath.Join(pathToLayer, "usr/lib")
133+
libContents2, err := ioutil.ReadDir(libPath)
134+
if err != nil {
135+
return matches, err
136+
}
137+
138+
for _, file := range append(libContents, libContents2...) {
133139
pattern := regexp.MustCompile("^python[0-9]+\\.[0-9]+$")
134140
match := pattern.FindString(file.Name())
135141
if match != "" {

0 commit comments

Comments
 (0)