armbian-next: HACK: ROOTFSCACHE_VERSION is undefined and failing everytime

This commit is contained in:
Ricardo Pardini 2022-09-04 22:13:46 +02:00
parent 9137a9de3f
commit b73e72721a
No known key found for this signature in database
GPG Key ID: 3D38CA12A66C5D02

View File

@ -5,10 +5,17 @@ get_or_create_rootfs_cache_chroot_sdcard() {
# @TODO: this was moved from configuration to this stage, that way configuration can be offline
# if variable not provided, check which is current version in the cache storage in GitHub.
if [[ -z "${ROOTFSCACHE_VERSION}" ]]; then
display_alert "ROOTFSCACHE_VERSION not set, getting remotely" "Github API and armbian/mirror " "debug"
ROOTFSCACHE_VERSION=$(curl https://api.github.com/repos/armbian/cache/releases/latest -s --fail | jq .tag_name -r || true)
# anonymous API access is very limited which is why we need a fallback
ROOTFSCACHE_VERSION=${ROOTFSCACHE_VERSION:-$(curl -L --silent https://cache.armbian.com/rootfs/latest --fail)}
if [[ "${SKIP_ARMBIAN_REPO}" != "yes" ]]; then
display_alert "ROOTFSCACHE_VERSION not set, getting remotely" "Github API and armbian/mirror " "debug"
# rpardini: why 2 calls?
ROOTFSCACHE_VERSION=$(curl https://api.github.com/repos/armbian/cache/releases/latest -s --fail | jq .tag_name -r || true)
# anonymous API access is very limited which is why we need a fallback
# rpardini: yeah but this is 404'ing
#ROOTFSCACHE_VERSION=${ROOTFSCACHE_VERSION:-$(curl -L --silent https://cache.armbian.com/rootfs/latest --fail)}
display_alert "Remotely-obtained ROOTFSCACHE_VERSION" "${ROOTFSCACHE_VERSION}" "debug"
else
ROOTFSCACHE_VERSION=668 # The neighbour of the beast.
fi
fi
local packages_hash=$(get_package_list_hash)