From 39076a4435bdf08a06363f80cf8e210cbc9285be Mon Sep 17 00:00:00 2001 From: termux-pacman-bot Date: Wed, 24 Sep 2025 02:53:15 +0000 Subject: [PATCH] fix(scripts/termux_setup_treesitter): fix auto-update - missed variable name mismatch when introduced in #25008 --- packages/tree-sitter/build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/tree-sitter/build.sh b/packages/tree-sitter/build.sh index 5aeb07c08c..660f8d939f 100644 --- a/packages/tree-sitter/build.sh +++ b/packages/tree-sitter/build.sh @@ -1,13 +1,15 @@ -TERMUX_PKG_HOMEPAGE=https://github.com/tree-sitter/tree-sitter +TERMUX_PKG_HOMEPAGE=https://tree-sitter.github.io/ TERMUX_PKG_DESCRIPTION="An incremental parsing system for programming tools" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Joshua Kahn @TomJo2000" TERMUX_PKG_VERSION="0.25.10" +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=ad5040537537012b16ef6e1210a572b927c7cdc2b99d1ee88d44a7dcdc3ff44c TERMUX_PKG_BREAKS="libtreesitter" TERMUX_PKG_REPLACES="libtreesitter" TERMUX_PKG_AUTO_UPDATE=true +TERMUX_PKG_UPDATE_VERSION_REGEXP="^\d+\.\d+\.\d+$" TERMUX_PKG_BUILD_IN_SRC=true termux_pkg_auto_update() { @@ -20,12 +22,18 @@ termux_pkg_auto_update() { return fi + if ! grep -oP "${TERMUX_PKG_UPDATE_VERSION_REGEXP}" <<< "${latest_release}"; then + echo "INFO: Tag '${latest_release}' does not look like a stable version." + return + fi + # Do not forget to bump revision of reverse dependencies and rebuild them # after SOVERSION is changed. local _SOVERSION=0.25 # This blocks auto-updates to an incompatible SO version. if [[ "${latest_release}" != "${_SOVERSION}".* ]]; then + echo "Latest release is '${latest_release}'" >&2 termux_error_exit "SOVERSION guard check failed." fi @@ -37,7 +45,7 @@ termux_pkg_auto_update() { NEW_TS_SHA256=$(sha256sum "$TS_TMPFILE" | cut -d' ' -f1) sed \ - -e "s|\(^\s*\)local TERMUX_TREE_SITTER_SHA256=[0-9a-f]*|\1local TS_GZ_SHA256=${NEW_TS_SHA256}|" \ + -e "s|\(^\s*\)local TERMUX_TREE_SITTER_SHA256=[0-9a-f]*|\1local TERMUX_TREE_SITTER_SHA256=${NEW_TS_SHA256}|" \ -i "${TERMUX_SCRIPTDIR}/scripts/build/setup/termux_setup_treesitter.sh" termux_pkg_upgrade_version "${latest_release}"