Skip to content

Commit 666728f

Browse files
committed
fix(main/dialog): implement working termux_pkg_auto_update()
1 parent 21b9e57 commit 666728f

1 file changed

Lines changed: 6 additions & 24 deletions

File tree

packages/dialog/build.sh

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ TERMUX_PKG_LICENSE="LGPL-2.1"
44
TERMUX_PKG_MAINTAINER="@termux"
55
TERMUX_PKG_DEPENDS="libandroid-support, ncurses"
66
TERMUX_PKG_VERSION="1.3-20260107"
7+
TERMUX_PKG_REVISION=1
78
TERMUX_PKG_SRCURL="https://invisible-island.net/archives/dialog/dialog-${TERMUX_PKG_VERSION}.tgz"
89
TERMUX_PKG_SHA256=78b3dd18d95e50f0be8f9b9c1e7cffe28c9bf1cdf20d5b3ef17279c4da35c5b5
910
TERMUX_PKG_AUTO_UPDATE=true
@@ -15,31 +16,12 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
1516
"
1617

1718
termux_pkg_auto_update() {
18-
local latest_version version_part date_part
19-
latest_version="$(termux_repology_api_get_latest_version "${TERMUX_PKG_NAME}")"
20-
# dialog is commonly packaged with a '-', '.', '_' or '+' delimiter
21-
# between the version and date parts. We want to normalize that to a '-'.
22-
version_part="${latest_version%[^0-9]*}"
23-
date_part="${latest_version##*[^0-9]}"
19+
local latest_version="$(curl --silent \
20+
https://invisible-island.net/datafiles/release/dialog.tar.gz | \
21+
tar --exclude='*/*' -tz | \
22+
sed 's|dialog-\(.*\)/|\1|')"
2423

25-
if [[ -z "$version_part" || -z "$date_part" ]]; then
26-
termux_error_exit <<-EOF
27-
Couldn't parse latest_version for '$TERMUX_PKG_NAME'
28-
Current version: $TERMUX_PKG_VERSION
29-
Fetched version: $latest_version
30-
Version part : $version_part
31-
Date part : $date_part
32-
EOF
33-
# Sanity check that the new version is newer than the current one.
34-
elif (( date_part < ${TERMUX_PKG_VERSION##*[^0-9]} )); then
35-
termux_error_exit <<-EOF
36-
Reported latest_version appears to be older than what we package?
37-
Current version: $TERMUX_PKG_VERSION
38-
Reported latest: $latest_version
39-
EOF
40-
fi
41-
42-
termux_pkg_upgrade_version "${version_part}-${date_part}"
24+
termux_pkg_upgrade_version "${latest_version}"
4325
}
4426

4527
termux_step_pre_configure() {

0 commit comments

Comments
 (0)