diff --git a/internal/rosa/python.go b/internal/rosa/python.go index 4af5c0ef..cfd2a22f 100644 --- a/internal/rosa/python.go +++ b/internal/rosa/python.go @@ -85,6 +85,10 @@ func init() { type PipHelper struct { // Whether to omit --no-build-isolation. BuildIsolation bool + // Whether to enter source after install. + EnterSource bool + // Runs after install. + Script string } var _ Helper = new(PipHelper) @@ -119,12 +123,18 @@ func (attr *PipHelper) script(name string) string { --no-build-isolation \` } + script := attr.Script + if attr.EnterSource { + script = "cd '/usr/src/" + name + "'\n" + script + } + return ` pip3 install \ --no-index \ --prefix=/system \ --root=/work \` + extra + ` - '/usr/src/` + name + `'` + '/usr/src/` + name + `' +` + script } // newViaPip installs a pip wheel from a url.