Add installaurpackage and updateaurpackages scripts

This commit is contained in:
Rob Watson 2021-04-03 11:50:03 +02:00
parent ab4517bea9
commit 9b8d72b17f
2 changed files with 31 additions and 0 deletions

17
script/installaurpackage Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Install an AUR package, passing the Git URL as the only argument.
set -e
if [ -z "$1" ]; then
echo "Usage: installaur <git url>"
exit 1
fi
pkgdir=$HOME/pkg
basename=$(basename "$1" ".git")
cd "$pkgdir"
git clone --depth=1 --quiet "$1" "$basename"
cd "$basename"
makepkg -si

14
script/updateaurpackages Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
#
# Update all AUR packages in $HOME/pkg
find $HOME/pkg -mindepth 1 -maxdepth 1 -type d -print0 | while read -d $'\0' pkgdir
do
cd "$pkgdir"
pullres=$(git pull --rebase)
if [ "$pullres" = "Already up to date." ]; then
continue
fi
makepkg -si --noconfirm --needed
done