From ec98636db75239329df0b65e56ca7124a71ecaa9 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sat, 10 Jul 2021 18:11:50 +0200 Subject: setup-apkrepos: Support enabling community repo --- setup-apkrepos.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup-apkrepos.in b/setup-apkrepos.in index f36ce4c..07d8e06 100644 --- a/setup-apkrepos.in +++ b/setup-apkrepos.in @@ -109,9 +109,10 @@ get_alpine_release() { add_mirror() { local mirror="$1" + community_char="$([ "$enable_community" = true ] || echo -n "#")" mkdir -p "${APKREPOS_PATH%/*}" echo "${mirror%/}/${release}/main" >> $APKREPOS_PATH - echo "#${mirror%/}/${release}/community" >> $APKREPOS_PATH + echo "${community_char}${mirror%/}/${release}/community" >> $APKREPOS_PATH case "$release" in v[0-9]*) echo "#${mirror%/}/edge/main" >> $APKREPOS_PATH; @@ -138,11 +139,12 @@ edit_repositories() { usage() { cat <<-__EOF__ - usage: setup-apkrepos [-fhr] [REPO...] + usage: setup-apkrepos [-cfhr1] [REPO...] Setup apk repositories options: + -c Enable the community repo -f Detect and add fastest mirror -h Show this help -r Add a random mirror and do not prompt @@ -152,11 +154,13 @@ usage() { } +enable_community=false add_fastest=false add_first=false add_random=false while getopts "1fhr" opt; do case $opt in + c) enable_community=true;; f) add_fastest=true;; 1) add_first=true;; h) usage;; -- cgit v1.2.3