summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Wilhelm <willat8@gmail.com>2023-01-01 04:57:36 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2023-01-24 13:35:09 +0000
commite6711d286b02fe7ae0d6677b139fe5af0978b2fb (patch)
tree4baac30fca24d4dc91f08ce64273c7b389690757
parent4c76a50f6ee44a37f33c135569efb54fa2b5ce72 (diff)
downloadalpine-conf-e6711d286b02fe7ae0d6677b139fe5af0978b2fb.zip
setup-apkrepos: version detection for edge
-rw-r--r--setup-apkrepos.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/setup-apkrepos.in b/setup-apkrepos.in
index 0c6b719..a7bfe1b 100644
--- a/setup-apkrepos.in
+++ b/setup-apkrepos.in
@@ -105,7 +105,8 @@ add_from_list() {
}
get_alpine_release() {
- local version="$(cat "${ROOT}"etc/alpine-release 2>/dev/null)"
+ local version="$(grep -Eom1 '[^/]+/main/?$' "${ROOT}"etc/apk/repositories | grep -Eo '^[^/]+' \
+ || cat "${ROOT}"etc/alpine-release 2>/dev/null)"
case "$version" in
*_git*|*_alpha*) release="edge";;
[0-9]*.[0-9]*.[0-9]*)