From 9b8d72b17f45025e633085bb571653ee69e0de27 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Sat, 3 Apr 2021 11:50:03 +0200 Subject: [PATCH] Add installaurpackage and updateaurpackages scripts --- script/installaurpackage | 17 +++++++++++++++++ script/updateaurpackages | 14 ++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 script/installaurpackage create mode 100755 script/updateaurpackages diff --git a/script/installaurpackage b/script/installaurpackage new file mode 100755 index 0000000..7c57316 --- /dev/null +++ b/script/installaurpackage @@ -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 " + exit 1 +fi + +pkgdir=$HOME/pkg +basename=$(basename "$1" ".git") +cd "$pkgdir" +git clone --depth=1 --quiet "$1" "$basename" +cd "$basename" +makepkg -si diff --git a/script/updateaurpackages b/script/updateaurpackages new file mode 100755 index 0000000..b752caf --- /dev/null +++ b/script/updateaurpackages @@ -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