Update repo

This commit is contained in:
termux-pacman-bot
2026-01-29 08:47:56 +00:00
parent d3f34412ee
commit 9d0ea4c7b4
3 changed files with 24 additions and 13 deletions

View File

@@ -144,9 +144,6 @@ declare -A _ALREADY_SEEN=() # Array of successful or packages and their old/new
_fetch_and_cache_tags() {
echo "INFO: Fetching and caching tags"
# First invocation of termux_repology_api_get_latest_version fetches and caches repology metadata.
quiet termux_repology_api_get_latest_version ' '
local __PACKAGES=()
local __GITHUB_PACKAGES=()
@@ -473,6 +470,24 @@ export IPC_FIFO="${TMPDIR:-/tmp}/termux_ipc_$$.fifo"
mkfifo "$IPC_FIFO"
exec {IPC_FIFO_FD}<>"$IPC_FIFO"
# If the dependencies for the 'dump-repology-data' script are not yet present,
# create a venv, activate the venv, and install them in the venv before running the
# 'dump-repology-data' script
if ! python3 -c "import requests" 2>/dev/null; then
dump_repology_data_venv_dir="$(mktemp -d)"
python3 -m venv --system-site-packages "$dump_repology_data_venv_dir"
source "$dump_repology_data_venv_dir/bin/activate"
echo "INFO: Installing the dependencies of the 'dump-repology-data' script"
pip3 install requests
fi
echo "INFO: Running the 'dump-repology-data' script"
if python3 "${TERMUX_SCRIPTDIR}"/scripts/updates/api/dump-repology-data "${TERMUX_REPOLOGY_DATA_FILE}"; then
echo "INFO: The 'dump-repology-data' script was successful"
else
echo "INFO: The 'dump-repology-data' script was unsuccessful, so an empty json is being placed in \${TERMUX_REPOLOGY_DATA_FILE}"
echo "{}" > "${TERMUX_REPOLOGY_DATA_FILE}"
fi
if [[ "$1" == "@all" ]]; then
declare -a PACKAGE_LIST=()
# To conserve API limits and speed up update checking,

View File

@@ -15,15 +15,6 @@ termux_repology_api_get_latest_version() {
termux_error_exit "Usage: ${FUNCNAME[0]} PKG_NAME"
fi
if [[ ! -s "${TERMUX_REPOLOGY_DATA_FILE}" ]]; then
# We should not install them in the case if python packages are externally managed.
find /usr/lib/python3.* -name EXTERNALLY-MANAGED -print -quit | grep -q . || \
pip3 install bs4 requests >/dev/null # Install python dependencies.
python3 "${TERMUX_SCRIPTDIR}"/scripts/updates/api/dump-repology-data \
"${TERMUX_REPOLOGY_DATA_FILE}" >/dev/null || \
echo "{}" > "${TERMUX_REPOLOGY_DATA_FILE}"
fi
# Why `--arg`? See: https://stackoverflow.com/a/54674832/15086226; `sub` strips the leading 'v'
jq -r --arg pkg "$1" '.[$pkg] // "null" | sub("^v";"")' "$TERMUX_REPOLOGY_DATA_FILE"
}

View File

@@ -14,10 +14,15 @@ termux_pkg_auto_update() {
local project_host
IFS='/' read -r _ _ project_host _ <<< "${TERMUX_PKG_SRCURL}"
# gitlab.gnome.org started responding to API requests originating from
# GitHub Actions with HTTP 403 errors in January 2026.
# Example command failing in GitHub Actions:
# curl https://gitlab.gnome.org/api/v4/projects/GNOME%2Fvte/releases/permalink/latest
# See: https://github.com/termux/termux-packages/issues/28242
if [[ -z "${TERMUX_PKG_UPDATE_METHOD}" ]]; then
if [[ "${project_host}" == "github.com" ]]; then
TERMUX_PKG_UPDATE_METHOD="github"
elif [[ "$TERMUX_PKG_SRCURL" == *"/-/archive/"* ]]; then
elif [[ "$TERMUX_PKG_SRCURL" == *"/-/archive/"* && "$TERMUX_PKG_SRCURL" != *"gitlab.gnome.org"* ]]; then
TERMUX_PKG_UPDATE_METHOD="gitlab"
else
TERMUX_PKG_UPDATE_METHOD="repology"