manibuilder/anita: Resolve actual pkgsrc URL with curl
Older NetBSD releases seem to have problems with the current redirects
on pkgsrc mirrors. So we try to resolve a current, final URL with curl
and force the scheme back to http.
Change-Id: I0a975a6c7c698eeea6ab0a267b11370e2b3e4770
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/375
diff --git a/util/manibuilder/Dockerfile.anita b/util/manibuilder/Dockerfile.anita
index eed0eed..357f39e 100644
--- a/util/manibuilder/Dockerfile.anita
+++ b/util/manibuilder/Dockerfile.anita
@@ -4,7 +4,7 @@
useradd -p locked -m mani && \
apt-get -qq update && \
apt-get -qq upgrade && \
- apt-get -qqy install git python-is-python3 python3-pexpect \
+ apt-get -qqy install curl git python-is-python3 python3-pexpect \
python3-distutils genisoimage qemu-system && \
apt-get clean
@@ -27,7 +27,10 @@
ARG RUNTIME_MEM=128M
ARG ORIGIN=https://review.sourcearcade.org/flashprog.git
ARG PKG_PATH=http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/7.1/All
-RUN cd && anita --persist --memory-size=${RUNTIME_MEM} --run \
+RUN cd && \
+ PKG_PATH=$(curl -ILso /dev/null -w %{url_effective} ${PKG_PATH}) && \
+ PKG_PATH=http:${PKG_PATH#http*:} && \
+ anita --persist --memory-size=${RUNTIME_MEM} --run \
"echo 'dhcpcd --waitip' >init && \
echo 'export PKG_PATH=${PKG_PATH}' >>init && \
. ./init && \