1
1
Fork 0

added install_yaourt script

This commit is contained in:
david 2013-04-11 21:01:59 +02:00
parent 0fa61cdf1a
commit c1b4c585c7
1 changed files with 40 additions and 0 deletions

40
install_yaourt.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
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
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; echo "everything done"; echo