Read pkgver through one parser in sync-aur
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 <codex@openai.com>
This commit is contained in:
+4
-1
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user