termux-packages/scripts/updates/internal/termux_repology_auto_update.sh
Aditya Alok d67a38d324
refactor(auto-update): clean up some code
- move epoch addition to termux_pkg_upgrade_version set.
- now termux_pkg_upgrade_version can be given retrived version/tag from
  api, directly.

Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
2022-04-05 11:21:14 +05:30

13 lines
534 B
Bash

# shellcheck shell=bash
termux_repology_auto_update() {
local latest_version
latest_version="$(termux_repology_api_get_latest_version "${TERMUX_PKG_NAME}")"
# Repology api returns null if package is not tracked by repology or is already upto date.
if [[ "${latest_version}" == "null" ]]; then
echo "INFO: Already up to date." # Since we exclude unique to termux packages from auto-update,
# this package should be tracked by repology and be already up to date.
return 0
fi
termux_pkg_upgrade_version "${latest_version}"
}