-
Notifications
You must be signed in to change notification settings - Fork 0
/
aura.zsh
executable file
·42 lines (30 loc) · 981 Bytes
/
aura.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env zsh
set -e
set -u
main () {
url='https://aur.archlinux.org/cgit/aur.git/snapshot/aura-bin.tar.gz'
tar_file='aura-bin.tar.gz'
sudo -S pacman -S --noconfirm curl grep sed sudo tar
sudo cp /etc/makepkg.conf /etc/makepkg.conf.bak
sudo cp etc/makepkg.conf /etc/makepkg.conf
build_dir=$(mktemp -d)
cd $build_dir
curl -L -o $tar_file $url
tar -xzf $tar_file
cd aura-bin
depends=$(grep "^depends=" PKGBUILD)
depends=("${(s/=/)depends}")
depends=($=depends[2])
depends=$(echo $depends | tr '(' ' ' | tr ')' ' ' | sed "s/'//g")
# TODO: This line is failing, but comment it out and install the dependencies manually.
sudo -S pacman -S --noconfirm $(echo $depends)
sudo -S chgrp -R nobody $build_dir
sudo -S chmod -R g+rwX $build_dir
sudo -S -u nobody makepkg
aura_bin=$(ls aura-bin-*.tar.zst)
sudo -S pacman -U --noconfirm $aura_bin
sudo -S rm -rf $build_dir
sudo cp /etc/makepkg.conf.bak /etc/makepkg.conf
}
main
exit