From f7142c23db5ff44a13fdc185e6c3235ef8d897e9 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Wed, 30 Jun 2021 10:59:44 +0300 Subject: [PATCH] termux-tools: pkg: ensure that pkgcache exists before attempting to check modification time --- packages/termux-tools/build.sh | 2 +- packages/termux-tools/pkg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/termux-tools/build.sh b/packages/termux-tools/build.sh index 52fdac5ad..6188bf6c2 100644 --- a/packages/termux-tools/build.sh +++ b/packages/termux-tools/build.sh @@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://termux.com/ TERMUX_PKG_DESCRIPTION="Basic system tools for Termux" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION=0.129 +TERMUX_PKG_VERSION=0.130 TERMUX_PKG_SKIP_SRC_EXTRACT=true TERMUX_PKG_PLATFORM_INDEPENDENT=true TERMUX_PKG_ESSENTIAL=true diff --git a/packages/termux-tools/pkg b/packages/termux-tools/pkg index 10074575f..9388c3112 100755 --- a/packages/termux-tools/pkg +++ b/packages/termux-tools/pkg @@ -90,7 +90,7 @@ select_mirror() { # Mirrors are rotated if 6 hours timeout has been passed or mirror is no longer accessible. local pkgcache="@TERMUX_CACHE_DIR@/apt/pkgcache.bin" - if (( $(last_modified "$pkgcache") <= 6 * 3600 )); then + if [ -e "$pkgcache" ] && (( $(last_modified "$pkgcache") <= 6 * 3600 )); then if [ -n "$current_mirror" ]; then echo -n "Checking availability of current mirror: " if check_mirror "$current_mirror"; then