Browse Source

examples: remove rebuild

This only covers a fraction of cases and is undocumented.
pull/1001/head
Alad Wenter 3 months ago
parent
commit
e7f1f09053
  1. 35
      examples/rebuild

35
examples/rebuild

@ -1,35 +0,0 @@
#!/bin/bash
XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
AURDEST=${AURDEST:-$XDG_CACHE_HOME/aurutils/$argv0}
AUR_LOCATION=${AUR_LOCATION:-https://aur.archlinux.org}
get_package() {
if git ls-remote --exit-code "$AUR_LOCATION/$1"; then
aur fetch "$1"
elif pkgbase=$(aur query -t info "$1" | jq -er '.results[].PackageBase'); then
aur fetch "$pkgbase"
elif asp update "$1"; then
asp export "$1"
fi
}
if cd "$AURDEST"; then
while read -r repo pkg; do
if [[ ! -d $pkg ]]; then
get_package "$pkg"
fi
if cd "$AURDEST/$pkg" && [[ -f PKGBUILD ]]; then
if setconf PKGBUILD "pkgrel+=0.1"; then
aur build -d "$repo" --remove "$@"
fi
else
printf >&2 '%s: invalid argument\n' "$pkg"
exit 22
fi
done < <(checkrebuild)
else
exit 1
fi
Loading…
Cancel
Save