Skip to content

Instantly share code, notes, and snippets.

@RustyRaptor
Last active January 12, 2024 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RustyRaptor/22ae7eb0be85fad22647f81c36df3927 to your computer and use it in GitHub Desktop.
Save RustyRaptor/22ae7eb0be85fad22647f81c36df3927 to your computer and use it in GitHub Desktop.
Update all AUR git repos in a folder
#!/bin/sh
# Place this in the folder where you git clone AUR repos
# Make it executable and just run it in place.
# Doesn't always succeed you still need to monitor the output
# and fix things when they break.
for dir in */; do
echo "$dir"
cd "$dir"
git fetch
git stash
git clean -f -X
GITPULLOUTPUT=$(git pull)
UPDATEDTEXT=$(echo "Already up to date.")
if [ "$GITPULLOUTPUT" != "$UPDATEDTEXT" ]
then
echo "updating"
makepkg -si --noconfirm
fi
# Uncomment to run makepkg on all folders regardless
# makepkg -si --noconfirm
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment