summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2020-06-18 22:02:13 +0100
committerDavid T. Sadler <davidtsadler@googlemail.com>2020-06-18 22:02:13 +0100
commit2dd70d8fc8be7ea5c3ffc6deea05c50fea2ab692 (patch)
tree62170f37f103fe48696de1c3604f0179081f21b2
parent2fbed11fd832be97ac0b09b4c68444a4dc2c580c (diff)
Install yay
-rw-r--r--gohan.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/gohan.sh b/gohan.sh
index 89c84e7..42cb4df 100644
--- a/gohan.sh
+++ b/gohan.sh
@@ -111,6 +111,20 @@ configure_sudo() {
[ -f /etc/sudoers ] && sed -i "s/# %wheel ALL=(ALL) NOPASSWORD: ALL/%wheel ALL=(ALL) NOPASSWORD: ALL/" /etc/sudoers
}
+install_yay() {
+ [ -f "/usr/bin/yay" ] || (
+ dialog --infobox "Installing \"yay\", an AUR helper..." 4 50
+ cd /tmp || exit
+ rm -rf /tmp/yay*
+ # Use all cores for compilation.
+ sed -i "s/-j2/-j$(nproc)/;s/^#MAKEFLAGS/MAKEFLAGS/" /etc/makepkg.conf
+ curl -sO https://aur.archlinux.org/cgit/aur.git/snapshot/yay.tar.gz &&
+ sudo -u "$name" tar -xvf yar.tar.gz >/dev/null 2>&1 &&
+ cd yay &&
+ sudo -u "$name" makepkg --noconfirm -si >/dev/null 2>&1
+ cd /tmp || return);
+}
+
### THE ACTUAL SCRIPT ###
install_from_pacman dialog || error "Are you sure you're running this as the root user and have an internet connection?"
@@ -129,6 +143,8 @@ configure_sudo
install_dotfiles $dotfilesrepo "/home/$name/.local/src/dotfiles"
+install_yay
+
install_software
clear