systemrescue-zfs/airootfs/usr/bin/yay
Gerd v. Egidy 704d7a9e5c add yay AUR-helper (#139)
- call yay through a wrapper to take care of root/sudo handling
- add yay-prepare to reinstall everything that was stripped for size (like /usr/include)
- yay-prepare creates a yay user and sudo rights
- the wrapper is installed in /usr/bin/yay, we want it to clash with yay-packages that aren't adapted to SystemRescue
2022-10-02 15:34:00 +02:00

24 lines
523 B
Bash
Executable file

#!/bin/bash
#
# yay wrapper to adapt yay to SystemRescue
#
# Author: Gerd v. Egidy
# SPDX-License-Identifier: GPL-3.0-or-later
#
# see https://www.system-rescue.org/manual/Installing_packages_from_AUR/ for details
#
if ! id yay >/dev/null 2>&1; then
echo "system not prepared for running yay yet, call 'yay-prepare'"
exit 1
fi
# escape all parameters with ${var@Q}
escArgArray=()
for arg in "$@" ; do
escArgArray+=(${arg@Q})
done
cmdstr="/usr/bin/yay-real ${escArgArray[@]}"
su -s /bin/bash yay -c "$cmdstr"