From bed763639442a2a36f0f193c5fdc32c543469d8d Mon Sep 17 00:00:00 2001 From: Omabot Date: Thu, 20 Aug 2026 04:28:15 -0700 Subject: [PATCH] Read pkgver through one parser in sync-aur MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit apply_pkgrel_override compares the checked-in pkgver against the incoming one to decide whether Omarchy's pkgrel metadata has gone stale, but read the two sides differently: previous_pkgver came from get_pkgbuild_field, which strips quotes, while current_pkgver was parsed again in place and kept them. A PKGBUILD writing pkgver='1.0' therefore compared unequal to itself, and the pkgrel metadata of an unchanged package was deleted on every sync. spotify, rustdesk and limine-mkinitcpio-hook all quote pkgver. None carries pkgrel metadata today, so nothing has been losing a suffix, but rebuild_on writes exactly that metadata and would have had it thrown away on the next sync. Reading through the same accessor rather than parsing a second time removes the divergence instead of correcting one side of it. 🤖 Generated by Opus 5 in Claude Code. Reviewed by Codex XHigh. Co-Authored-By: Codex XHigh --- bin/sync-aur | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/sync-aur b/bin/sync-aur index fb493a8..59af6ca 100755 --- a/bin/sync-aur +++ b/bin/sync-aur @@ -246,7 +246,10 @@ apply_pkgrel_override() { jq -e 'has("pkgrel")' "$metadata" >/dev/null || return 1 local current_pkgver suffix offset base rel tmpfile - current_pkgver=$(grep -m1 '^pkgver=' "$pkgbuild" | cut -d= -f2) + # Read through the same accessor that produced previous_pkgver. Parsing it a + # second time here let a quoted pkgver= compare unequal to itself, which threw + # away the pkgrel metadata of an unchanged package on every sync. + current_pkgver=$(get_pkgbuild_field "$package_dir" pkgver) if [[ -n "$previous_pkgver" && "$current_pkgver" != "$previous_pkgver" ]]; then print_info "Removing stale pkgrel metadata for $(display_package_name "$package_dir") (pkgver changed: $previous_pkgver -> $current_pkgver)"