Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try aur srcver with and without --no-prepare #103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion lib/aurto/sync-devel
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,31 @@ while IFS=: read -r mode rev_old rev path; do
esac
done <"$tmp"/fetch_results

# Probe `aur srcver` with and without the `--no-prepare` option.
# - A `prepare()` function can fail without its `makedepends`.
# (These are not available.)
# - Typically `prepare()` is not required to run `pkgver()`.
#
# Usage: srcver <package ...>
srcver() {
local srcver=()
for pkg in "${@}"; do
local ver=""
if ! ver=$(
set +e
aur srcver --no-prepare "${pkg}" 2>/dev/null
); then
ver=$(aur srcver "${pkg}")
fi
srcver+=("${ver}")
done
echo "${srcver[@]}"
}

# Update `epoch:pkgver-pkgrel` for each target with `aur-srcver`.
# This runs `makepkg`, cloning upstream to the latest revision. The
# output is then compared with the contents of the local repository.
aur vercmp -p <(aur srcver "${targets[@]}") <"$tmp"/db | awk '{print $1}' >"$tmp"/ood
aur vercmp -p <(srcver "${targets[@]}") <"$tmp"/db | awk '{print $1}' >"$tmp"/ood

if [[ -s $tmp/ood ]]; then
aur build -a "$tmp"/ood "${build_args[@]}"
Expand Down