summaryrefslogtreecommitdiff
path: root/setup-apkrepos.in
diff options
context:
space:
mode:
authorLukas Bestle <mail@lukasbestle.com>2021-07-10 18:11:50 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2021-11-16 11:10:20 +0000
commitec98636db75239329df0b65e56ca7124a71ecaa9 (patch)
tree89e79f07bb69b4a5391ee2c7f9e1aadd79f8ae4f /setup-apkrepos.in
parent15aa0d7f76f0b7bd35e070dbc6f3782b1a6776a5 (diff)
downloadalpine-conf-ec98636db75239329df0b65e56ca7124a71ecaa9.zip
setup-apkrepos: Support enabling community repo
Diffstat (limited to 'setup-apkrepos.in')
-rw-r--r--setup-apkrepos.in8
1 files 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;;