feat(main/{x11,root}-repo): auto select mirror

Signed-off-by: Kevin Williams <admin@utermux.dev>
This commit is contained in:
Kevin Williams 2022-10-16 16:18:50 +08:00 committed by GitHub
parent 027aef8732
commit 13aa1bc22b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 10 deletions

View File

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-root-packages
TERMUX_PKG_DESCRIPTION="Package repository containing programs for rooted devices"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91"
TERMUX_PKG_VERSION=2.3
TERMUX_PKG_VERSION=2.4
TERMUX_PKG_DEPENDS="termux-keyring"
TERMUX_PKG_SKIP_SRC_EXTRACT=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
@ -14,8 +14,14 @@ termux_step_make_install() {
termux_step_create_debscripts() {
[ "$TERMUX_PACKAGE_FORMAT" = "pacman" ] && return 0
echo "#!$TERMUX_PREFIX/bin/sh" > postinst
echo "echo Downloading updated package list ..." >> postinst
echo "apt update" >> postinst
echo "exit 0" >> postinst
cat <<- EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
echo "Downloading updated package list ..."
if [ -d "$TERMUX_PREFIX/etc/termux/chosen_mirrors" ] || [ -f "$TERMUX_PREFIX/etc/termux/chosen_mirrors" ]; then
pkg --check-mirror update
else
apt update
fi
exit 0
EOF
}

View File

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://github.com/termux/x11-packages
TERMUX_PKG_DESCRIPTION="Package repository containing X11 programs and libraries"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=8.3
TERMUX_PKG_VERSION=8.4
TERMUX_PKG_DEPENDS="termux-keyring"
TERMUX_PKG_SKIP_SRC_EXTRACT=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
@ -14,8 +14,14 @@ termux_step_make_install() {
termux_step_create_debscripts() {
[ "$TERMUX_PACKAGE_FORMAT" = "pacman" ] && return 0
echo "#!$TERMUX_PREFIX/bin/sh" > postinst
echo "echo Downloading updated package list ..." >> postinst
echo "apt update" >> postinst
echo "exit 0" >> postinst
cat <<- EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
echo "Downloading updated package list ..."
if [ -d "$TERMUX_PREFIX/etc/termux/chosen_mirrors" ] || [ -f "$TERMUX_PREFIX/etc/termux/chosen_mirrors" ]; then
pkg --check-mirror update
else
apt update
fi
exit 0
EOF
}