2 # shellcheck disable=SC2086
3 # build--sync - helper for upgrading local repository
5 [[ -v AUR_DEBUG
]] && set -o xtrace
6 AUR_PACMAN_AUTH
=${AUR_PACMAN_AUTH:-sudo}
8 PS4
='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
11 printf >&2 '%s: repository not specified\n' "$argv0"
15 # propagate local repo contents
17 $AUR_PACMAN_AUTH pacsync
"$arg_repo"
18 $AUR_PACMAN_AUTH pacsync
"$arg_repo" --dbext=.files
20 # retrieve upgrade targets
22 while IFS
='/' read -r repo name
; do
23 if [[ $repo == "$arg_repo" ]]; then
24 targets
+=("$repo/$name")
26 done < <(pacman
-Sup --print-format '%r/%n')
29 if (( ${#targets[@]} )); then
30 printf >&2 "%s: upgrading packages in repository '%s'\n" "$argv0" "$arg_repo"
31 printf '%s\n' "${targets[@]}" |
$AUR_PACMAN_AUTH pacman
-S --noconfirm -
34 # vim: set et sw=4 sts=4 ft=sh: