From 2c5c902d50824d64deba8e1e47c4f60378853e69 Mon Sep 17 00:00:00 2001 From: misthios Date: Sun, 25 Sep 2022 18:47:55 +0200 Subject: [PATCH 1/2] setup-apkrepos: abort on failure to fetch mirrors also drop unnessary check --- setup-apkrepos.in | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/setup-apkrepos.in b/setup-apkrepos.in index 504025e..4b1cbfd 100644 --- a/setup-apkrepos.in +++ b/setup-apkrepos.in @@ -170,7 +170,9 @@ done shift $(($OPTIND - 1)) if [ -z "$MIRRORS" ]; then - MIRRORS=$(wget -qO- $MIRRORS_URL) + if ! MIRRORS=$(wget -qO- $MIRRORS_URL); then + exit 1 + fi fi APKREPOS_PATH="${ROOT}"etc/apk/repositories @@ -206,10 +208,6 @@ if $add_fastest; then fi while ! $changed; do - if [ -z "$MIRRORS" ]; then - MIRRORS=$(wget -qO- $MIRRORS_URL) - fi - show_mirror_list ask_setup_method ${APKREPO_DEFAULT_ANSWER:-1} -- GitLab From 06ee90be1268a91d0681e4b5cba3b23b855e4353 Mon Sep 17 00:00:00 2001 From: misthios Date: Sun, 25 Sep 2022 18:52:54 +0200 Subject: [PATCH 2/2] setup-alpine.in: abort install when setup-apkrepos fails --- setup-alpine.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup-alpine.in b/setup-alpine.in index 952d7da..a8ec328 100644 --- a/setup-alpine.in +++ b/setup-alpine.in @@ -222,7 +222,11 @@ if ! is_kvm_clock && [ "$rc_sys" != "LXC" ] && [ "$quick" != 1 ]; then setup-ntp ${NTPOPTS} fi -setup-apkrepos ${APKREPOSOPTS} +#Abort when mirror setup fails +if ! setup-apkrepos ${APKREPOSOPTS}; then + echo "Failed to setup apk repos aborting.." + exit 1 +fi # Now that network and apk are operational we can install another device manager if [ "$rc_sys" != LXC ] && [ -n "$DEVDOPTS" -a "$DEVDOPTS" != mdev ]; then -- GitLab