From 2bb9ebb50a76e9251d029ba54460ee153766495b Mon Sep 17 00:00:00 2001 From: Douglas Teles Date: Wed, 24 Jun 2026 00:32:18 -0300 Subject: [PATCH] gen-pacman-repo: fall back to dirname when PKG_VERSION is a shell expr awk -F'"' '/^PKG_VERSION/ ...' pulls the literal string out of the package.mk, but a handful of packages set their version dynamically: PKG_VERSION="$(get_pkg_version gstreamer)" The build system resolves that at build time and the install_pkg dir ends up correctly named (gst-libav-1.27.1/). The packager, though, was storing the raw "$(get_pkg_version gstreamer)" string, which then went through the charset filter and became ".get_pkg_version.gstreamer." in the asset name. Five packages slipped through in the first repo-dev release with broken names (gst-libav, gst-plugins-good, vitaquake2-{rogue,xatrix,zaero}-lr). Detect any '$(' or '${' in the version string and treat it as "unresolved", which trips the existing dirname-suffix fallback. 27 ArchR packages use this pattern; the fix covers all of them. Co-Authored-By: Claude Opus 4.7 --- scripts/repo/gen-pacman-repo | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/repo/gen-pacman-repo b/scripts/repo/gen-pacman-repo index 4cef162cda..cfd1ff7e0f 100755 --- a/scripts/repo/gen-pacman-repo +++ b/scripts/repo/gen-pacman-repo @@ -74,6 +74,16 @@ build_one_pkg() { if [ -n "${pkgmk}" ]; then version="$(awk -F'"' '/^PKG_VERSION/ {print $2; exit}' "${pkgmk}")" fi + # Some package.mk files set PKG_VERSION dynamically, e.g.: + # PKG_VERSION="$(get_pkg_version gstreamer)" + # awk pulls the unresolved shell expansion as a string, which then + # turns into garbage like "..get_pkg_version.gstreamer." after the + # charset filter. Detect any $( ... ), :- or ${ and bail to the + # dirname fallback below, which holds the version the build system + # actually substituted. + case "${version}" in + *'$('* | *'${'* ) version="" ;; + esac # Fallback: pull the suffix back out of the dirname. if [ -z "${version}" ]; then version="${dirname#${name}-}"