build framework - MANAGE_ACNG - allow switch to be empty

This commit is contained in:
tabris
2025-10-24 00:14:16 -04:00
committed by Igor
parent 3c7ace8179
commit 42c52e34f4

View File

@@ -50,19 +50,24 @@ function create_new_rootfs_cache_via_debootstrap() {
# this is different between debootstrap and regular apt-get; here we use acng as a prefix to the real repo
declare debootstrap_apt_mirror="http://${APT_MIRROR}"
if [[ "${MANAGE_ACNG}" == "yes" ]]; then
local debootstrap_apt_mirror="http://localhost:3142/${APT_MIRROR}"
acng_check_status_or_restart
elif [[ "${MANAGE_ACNG}" == "no" ]]; then
: # do nothing
else
if [[ ! "${MANAGE_ACNG}" =~ ^https?:// ]]; then
exit_with_error "MANAGE_ACNG must be yes/no OR be a full URL with http/https" "${MANAGE_ACNG}"
else
# FIXME: although this works with mmdebstrap, there's a more idiomatic way with `--aptopt`
local debootstrap_apt_mirror="${MANAGE_ACNG}/${APT_MIRROR}"
fi
fi
case "${MANAGE_ACNG}" in
yes)
local debootstrap_apt_mirror="http://localhost:3142/${APT_MIRROR}"
acng_check_status_or_restart
;;
no) ;& # do nothing, fallthrough
"")
: # still do nothing
;; # stop falling
*)
if [[ ! "${MANAGE_ACNG}" =~ ^https?:// ]]; then
exit_with_error "MANAGE_ACNG must be yes/no OR be a full URL with http/https" "${MANAGE_ACNG}"
else
# FIXME: although this works with mmdebstrap, there's a more idiomatic way with `--aptopt`
local debootstrap_apt_mirror="${MANAGE_ACNG}/${APT_MIRROR}"
fi
;;
esac
# @TODO: one day: https://gitlab.mister-muffin.de/josch/mmdebstrap/src/branch/main/mmdebstrap