Skip to content

Commit

Permalink
Fix broken 'edge' branch
Browse files Browse the repository at this point in the history
When 'edge' branch was introduced it broke alpine cache update
the repository .../vedge/... is requested

Fix it by adding 'v' to the value of ALPINE_VERSION only if this
is not edge branch

Signed-off-by: Mikhail Malyshev <[email protected]>
  • Loading branch information
rucoder authored and eriknordmark committed Oct 30, 2023
1 parent f8d3322 commit 1d39d41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RUN [ -f /etc/apk/repositories.upstream ] || mv /etc/apk/repositories /etc/apk/r
RUN [ -f /etc/apk/cache.url ] || echo https://dl-cdn.alpinelinux.org/alpine > /etc/apk/cache.url
RUN for repo in main community testing; do \
for p in */"$repo"; do \
if [ ! -f "$p" ]; then echo "skipping $p"; continue; fi &&\
packages="" &&\
if [ -f "$p" ]; then packages="$packages $(cat "$p")"; fi &&\
if [ -f "$p.$(apk --print-arch)" ]; then packages="$packages $(cat "$p.$(apk --print-arch)")"; fi &&\
Expand Down
8 changes: 7 additions & 1 deletion pkg/alpine/build-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ bail() {

[ "$#" -gt 2 ] || bail "Usage: $0 <alpine version> <path to the cache> [packages...]"

ALPINE_REPO="$(cat /etc/apk/cache.url)/v$1"
ALPINE_VERSION=$1

if [ "$ALPINE_VERSION" != "edge" ]; then
ALPINE_VERSION=v$1
fi

ALPINE_REPO="$(cat /etc/apk/cache.url)/$ALPINE_VERSION"
CACHE="$2/$(apk --print-arch)"
ROOTFS="$CACHE/../rootfs"
shift 2
Expand Down

0 comments on commit 1d39d41

Please sign in to comment.