Add installaurpackage and updateaurpackages scripts
This commit is contained in:
parent
ab4517bea9
commit
9b8d72b17f
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue