Skip to content

Commit f5ec25b

Browse files
committed
[fix] : No hard coding user name
1 parent f69d25c commit f5ec25b

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

system/aur.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ if ! pacman -Qq yay 1> /dev/null 2>&1; then
6363
_oldpwd="$(pwd)"
6464
pacman -Syy --noconfirm --config "/etc/alteriso-pacman.conf"
6565
pacman --noconfirm -S --asdeps --needed go --config "/etc/alteriso-pacman.conf"
66-
sudo -u aurbuild git clone "https://aur.archlinux.org/yay.git" "/tmp/yay"
66+
sudo -u "${aur_username}" git clone "https://aur.archlinux.org/yay.git" "/tmp/yay"
6767
cd "/tmp/yay"
68-
sudo -u aurbuild makepkg --ignorearch --clean --cleanbuild --force --skippgpcheck --noconfirm
69-
pacman --noconfirm --config "/etc/alteriso-pacman.conf" -U $(sudo -u aurbuild makepkg --packagelist)
68+
sudo -u "${aur_username}" makepkg --ignorearch --clean --cleanbuild --force --skippgpcheck --noconfirm
69+
pacman --noconfirm --config "/etc/alteriso-pacman.conf" -U $(sudo -u "${aur_username}" makepkg --packagelist)
7070
cd ..
7171
rm -rf "/tmp/yay"
7272
cd "${_oldpwd}"
@@ -82,7 +82,7 @@ fi
8282
# Build and install
8383
chmod +s /usr/bin/sudo
8484
for _pkg in "${@}"; do
85-
yes | sudo -u aurbuild \
85+
yes | sudo -u "${aur_username}" \
8686
yay -Sy \
8787
--mflags "-AcC" \
8888
--aur \
@@ -108,7 +108,7 @@ done
108108
yay -Sccc --noconfirm --config "/etc/alteriso-pacman.conf"
109109

110110
# remove user and file
111-
userdel aurbuild
111+
userdel "${aur_username}"
112112
remove /aurbuild_temp
113113
remove /etc/sudoers.d/aurbuild
114114
remove "/etc/alteriso-pacman.conf"

system/pkgbuild.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ if ! pacman -Qq yay 1> /dev/null 2>&1; then
9090
_oldpwd="$(pwd)"
9191
pacman -Syy --noconfirm --config "/etc/alteriso-pacman.conf"
9292
pacman --noconfirm -S --asdeps --needed go --config "/etc/alteriso-pacman.conf"
93-
sudo -u pkgbuild git clone "https://aur.archlinux.org/yay.git" "/tmp/yay"
93+
sudo -u "${build_username}" git clone "https://aur.archlinux.org/yay.git" "/tmp/yay"
9494
cd "/tmp/yay"
95-
sudo -u pkgbuild makepkg --ignorearch --clean --cleanbuild --force --skippgpcheck --noconfirm
96-
pacman --noconfirm --config "/etc/alteriso-pacman.conf" -U $(sudo -u pkgbuild makepkg --packagelist)
95+
sudo -u "${build_username}" makepkg --ignorearch --clean --cleanbuild --force --skippgpcheck --noconfirm
96+
pacman --noconfirm --config "/etc/alteriso-pacman.conf" -U $(sudo -u "${build_username}" makepkg --packagelist)
9797
cd ..
9898
rm -rf "/tmp/yay"
9999
cd "${_oldpwd}"

0 commit comments

Comments
 (0)