dev-ml/ollama: move log ownership changes to pkg_preinst

Since the ollama UID and GID are dynamically assigned, we cannot rely on
them being the same on different machines. Calling fowners ollama:ollama
<file> in src_install could cause permission issues at runtime, when
e.g. a binary package is created on one machine and used on another.

Moving the offending code to pkg_preinst, which is called for binary and
source packages, solves the issue.

Closes: https://github.com/gentoo/guru/pull/210
Signed-off-by: Lucio Sauer <watermanpaint@posteo.net>
This commit is contained in:
Lucio Sauer
2024-07-11 02:49:08 +02:00
parent 3d3ace2191
commit ec9321fa79

View File

@@ -61,14 +61,16 @@ src_compile() {
}
src_install() {
touch /var/log/ollama.log || die
fowners ollama:ollama /var/log/ollama.log
dobin ollama
doinitd "${FILESDIR}"/ollama
fperms 0755 /etc/init.d/ollama
}
pkg_preinst() {
touch /var/log/ollama.log || die
fowners ollama:ollama /var/log/ollama.log
}
pkg_postinst() {
einfo "Quick guide:"
einfo "ollama serve"