From e163c82f150805e1fb34c2a0e0dacad90c6a4a40 Mon Sep 17 00:00:00 2001 From: anorien90 Date: Tue, 9 Dec 2025 14:05:13 +0100 Subject: [PATCH] fixed issue for makepkg paru and Root execution on worflow container --- dist/pacman.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dist/pacman.sh b/dist/pacman.sh index 21020f5..9433ca8 100755 --- a/dist/pacman.sh +++ b/dist/pacman.sh @@ -28,7 +28,20 @@ if command -v paru &> /dev/null; then else git clone https://aur.archlinux.org/paru.git cd paru - makepkg -si --noconfirm + + # Check if $USER is root and if so add a temporary non-root user for building paru + if [ "$EUID" -eq 0 ]; then + echo "Building paru as root is not allowed. Creating a temporary user for building..." + TEMP_USER="tempuser" + useradd -m "$TEMP_USER" + chown -R "$TEMP_USER":"$TEMP_USER" . + su -u "$TEMP_USER" -c "makepkg -si --noconfirm" + userdel -r "$TEMP_USER" + else + echo "Building paru as user $USER..." + makepkg -si --noconfirm + fi + cd .. rm -rf paru fi