unos-repository

APK repository for unos
git clone git://git.finwo.net/misc/unos-repository
Log | Files | Refs | README

commit 6d3909104e9cf65a521e8615091548260f5f4ac1
parent 88500519d40191e11967f820f7f096e1511e92ec
Author: Robin Bron <robin.bron@yourhosting.nl>
Date:   Fri, 25 Sep 2026 01:52:25 +0200

check-revision verifies curl is there

Diffstat:
Mmk/check-revision.sh | 26++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/mk/check-revision.sh b/mk/check-revision.sh @@ -73,11 +73,29 @@ case "${REPO}" in url="${REPO%/}/${APK_NAME}" # Normalize // in path (BUCKET_PUBLIC_URL may have trailing slash). url=$(printf "%s" "${url}" | sed 's#://#___PROTO___#; s#//*#/#g; s#___PROTO___#://#') - if curl -fsLI "${url}" >/dev/null 2>&1; then - echo "check-revision.sh: ${APK_NAME} already published at ${url}" >&2 - echo " bump revision in packages/${PKG}/template" >&2 - exit 1 + + if ! command -v curl >/dev/null 2>&1 && command -v apt-get >/dev/null 2>&1; then + apt-get update -qq >/dev/null 2>&1 || true + apt-get install -y -qq --no-install-recommends curl ca-certificates >/dev/null 2>&1 || true fi + command -v curl >/dev/null 2>&1 || { + echo "check-revision.sh: curl unavailable; cannot determine if ${APK_NAME} is published" >&2 + exit 2 + } + + code=$(curl -sSL -o /dev/null -w '%{http_code}' --head "${url}" 2>/dev/null) || code=000 + case "${code}" in + 2*) + echo "check-revision.sh: ${APK_NAME} already published at ${url}" >&2 + echo " bump revision in packages/${PKG}/template" >&2 + exit 1 + ;; + 404) ;; + *) + echo "check-revision.sh: cannot determine if ${APK_NAME} is published (HTTP ${code} for ${url})" >&2 + exit 2 + ;; + esac ;; *) if [ -f "${REPO}/${APK_NAME}" ]; then