Run makepkg --printsrcinfo in a scratch dir

nobody cannot write to the checkout on the Forgejo runner.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jonas Leder 2026-11-18 17:22:27 +01:00
commit b9f805f829

View file

@ -25,4 +25,9 @@ for type in source sha256sums; do
fi
done
done
sudo -u nobody makepkg --printsrcinfo > .SRCINFO
# makepkg runs as nobody, which cannot write to the checkout (owned by the runner user): use a scratch dir
tmpdir=$(mktemp -d)
cp PKGBUILD "${tmpdir}/"
chmod 777 "${tmpdir}"
(cd "${tmpdir}" && sudo -u nobody makepkg --printsrcinfo) > .SRCINFO
rm -rf "${tmpdir}"