diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-04-19 00:35:24 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-04-19 00:35:24 +0900 |
| commit | 992139c75d5ee2b66bc71a832a6675e53f917b3b (patch) | |
| tree | d77af8fedc590459e914cb4a991cb953dfe4afa6 /internal/rosa/python.go | |
| parent | 57c69b533e0dce5b4b6218ab8e0197505e0ea24c (diff) | |
internal/rosa/python: extra script after install
This is generally for test suite, due to the lack of standard or widely agreed upon convention.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/python.go')
| -rw-r--r-- | internal/rosa/python.go | 12 |
1 files changed, 11 insertions, 1 deletions
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. |
