chown the package build dir to the builder user

makepkg runs as the builder user and needs to write PKGDEST. /tmp/omarchy-pkg-build
is created by root, so without an explicit chown the build aborts with
'You do not have write permission for the directory $PKGDEST'.
This commit is contained in:
Ryan Hughes committed 2026-05-20 21:38:09 -04:00
1 parent b34f53629d
commit 8b0fd93011
1 file changed
+3 -1
+3 -1
View File
@@ -27,12 +27,14 @@ rm -rf "$work_dir"
mkdir -p "$work_dir"
# makepkg refuses to run as root; create a builder user with passwordless
# sudo for pacman dep installation during the build.
# sudo for pacman dep installation during the build, and hand it ownership
# of the work dir so PKGDEST writes succeed.
if ! id builder &>/dev/null; then
useradd -m -s /bin/bash builder
fi
echo 'builder ALL=(ALL) NOPASSWD: /usr/bin/pacman' > /etc/sudoers.d/99-omarchy-pkg-builder
chmod 440 /etc/sudoers.d/99-omarchy-pkg-builder
chown builder:builder "$work_dir"
pacman -Sy --noconfirm