david/scripts-archive
david
/
scripts-archive
Archived
1
0
Fork 0
This repository has been archived on 2022-04-16. You can view files and clone it, but cannot push or open issues or pull requests.
scripts-archive/install_yaourt.sh

44 lines
987 B
Bash
Executable File

#!/bin/bash
# archlinux yaourt installer
baselink="https://aur.archlinux.org/packages"
packages="package-query yaourt"
#uncomment following for passing the packages as option
#if [ -z $1 ]; then
# echo "usage: ./install_yaourt.sh <list of packages>"
# exit 1
#fi
#packages="$*"
tmpfolder="getyaourt"
sudo pacman -Syu
sudo pacman -S fakeroot binutils gcc make patch pkg-config wget git autoconf
for package in $packages; do
if [ -d /tmp/$tmpfolder ]; then
rm -rf /tmp/$tmpfolder #use sudo on a multiuser system
fi
mkdir /tmp/$tmpfolder
link=$(curl -s "$baselink/$package" | grep "Download tarball" | sed 's/"/\ /g' | awk '{print $3}')
cd /tmp/$tmpfolder
wget "https://aur.archlinux.org$link" && tar xzf *
cd $package; makepkg -s
if [ $? -eq 0 ]; then
sudo pacman -U *.xz
else
echo "error: could not source PKGBUILD"
fi
cd - > /dev/null
rm -rf /tmp/$tmpfolder
done
echo "info: everything done"