diff --git a/usr/local/bin/build.sh.orig b/usr/local/bin/build.sh old mode 100644 new mode 100755 index c3b8f7a..2d09c31 --- a/usr/local/bin/build.sh.orig +++ b/usr/local/bin/build.sh @@ -7,13 +7,14 @@ set -eu -o pipefail readonly APORTSDIR=$CI_PROJECT_DIR -readonly REPOS="main community testing non-free" +readonly ALPINE_REPOS="main community testing" readonly ARCH=$(apk --print-arch) # gitlab variables readonly BASEBRANCH=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME : "${REPODEST:=$HOME/packages}" -: "${MIRROR:=https://dl-cdn.alpinelinux.org/alpine}" +: "${MIRROR:=https://ayakael.net/api/packages/forge/alpine}" +: "${ALPINE_MIRROR:=http://dl-cdn.alpinelinux.org/alpine}" : "${MAX_ARTIFACT_SIZE:=300000000}" #300M : "${CI_DEBUG_BUILD:=}" @@ -67,13 +68,23 @@ report() { } get_release() { + echo $(grep PRETTY_NAME /etc/os-release | awk '{print $3}' | tr -d '"') +} + +readonly REPOS="qubes-$(get_release)" + +get_qubes_release() { case $BASEBRANCH in - *-stable) echo v"${BASEBRANCH%-*}";; - master) echo edge;; - *) die "Branch \"$BASEBRANCH\" not supported!" + r*) echo $BASEBRANCH;; + main) echo r4.3;; esac } +# hack to support at-root packages +changed_repos() { + echo "." +} + build_aport() { local repo="$1" aport="$2" cd "$APORTSDIR/$repo/$aport" @@ -101,11 +112,11 @@ set_repositories_for() { release=$(get_release) for repo in $REPOS; do [ "$repo" = "non-free" ] && continue - [ "$release" != "edge" ] && [ "$repo" == "testing" ] && continue + [ "$release" == "edge" ] && [ "$repo" == "backports" ] && continue repos="$repos $MIRROR/$release/$repo $REPODEST/$repo" [ "$repo" = "$target_repo" ] && break done - doas sh -c "printf '%s\n' $repos > /etc/apk/repositories" + doas sh -c "printf '%s\n' $repos >> /etc/apk/repositories" doas apk update } @@ -118,7 +129,15 @@ apply_offset_limit() { } setup_system() { - doas sh -c "echo $MIRROR/$(get_release)/main > /etc/apk/repositories" + local repos='' repo='' + local release + + release=$(get_release) + for repo in $ALPINE_REPOS; do + [ "$release" != "edge" ] && [ "$repo" == "testing" ] && continue + repos="$repos $ALPINE_MIRROR/$release/$repo" + done + doas sh -c "printf '%s\n' $repos > /etc/apk/repositories" doas apk -U upgrade -a || apk fix || die "Failed to up/downgrade system" abuild-keygen -ain doas sed -i -E 's/export JOBS=[0-9]+$/export JOBS=$(nproc)/' /etc/abuild.conf