Add function aur_update
This commit is contained in:
parent
20e6457fa0
commit
dca343b022
1 changed files with 21 additions and 0 deletions
|
@ -87,6 +87,27 @@ system_update() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
aur_update() {
|
||||||
|
local start_dir="$PWD"
|
||||||
|
for repo in $(dirname $(find ~/builds -name .git -type d)); do
|
||||||
|
cd && cd "$repo" && git fetch -q
|
||||||
|
local unpulled=$(git log --pretty=format:'%h' ..@{u} | wc -c)
|
||||||
|
if [ "$unpulled" -eq 0 ]; then
|
||||||
|
echo "$(basename "$repo") is up to date"
|
||||||
|
else
|
||||||
|
git pull && git chlog -p
|
||||||
|
echo -n "Update $repo? [y/N] "
|
||||||
|
read -r answer
|
||||||
|
if [ ! "$answer" = 'y' ]; then
|
||||||
|
continue
|
||||||
|
else
|
||||||
|
makepkg -cirs
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
cd "$start_dir" || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
pull_from_repos() {
|
pull_from_repos() {
|
||||||
local start_dir="$PWD"
|
local start_dir="$PWD"
|
||||||
for repo in "${GIT_REPOS[@]}"; do
|
for repo in "${GIT_REPOS[@]}"; do
|
||||||
|
|
Loading…
Add table
Reference in a new issue