From 9c1a3db18852520a8b72a4795c7b197bcc93e8a0 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 7 Jul 2021 21:35:35 -0700 Subject: [PATCH] Account for rc-buggy not existing on debian-ports --- download.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/download.sh b/download.sh index 2bb4c9d41..a6d8cc05a 100755 --- a/download.sh +++ b/download.sh @@ -64,17 +64,24 @@ for suite in "${!experimentalSuites[@]}"; do base="${experimentalSuites[$suite]}" if [ -f "$base/rootfs.tar.xz" ]; then [ ! -d "$suite" ] + [ -s "$base/rootfs.sources-list" ] + mirror="$(awk '$1 == "deb" { print $2; exit }' "$base/rootfs.sources-list")" + [ -n "$mirror" ] mkdir -p "$suite" + if ! wget -O "$suite/InRelease" "$snapshotUrl/dists/$suite/InRelease"; then + rm -f "$suite/InRelease" # delete the empty file "wget" creates + if ! { + wget -O "$suite/Release.gpg" "$snapshotUrl/dists/$suite/Release.gpg" && + wget -O "$suite/Release" "$snapshotUrl/dists/$suite/Release" + }; then + rm -rf "$suite" + continue # this suite must not exist! (rc-buggy on debian-ports 😔) + fi + fi # TODO else extract InRelease contents somehow (no keyring here) cat > "$suite/Dockerfile" <<-EODF FROM debian:$base - RUN echo 'deb http://deb.debian.org/debian $suite main' > /etc/apt/sources.list.d/experimental.list + RUN echo 'deb $mirror $suite main' > /etc/apt/sources.list.d/experimental.list EODF - if ! wget -O "$suite/InRelease" "$snapshotUrl/dists/$suite/InRelease"; then - rm -f "$suite/InRelease" # delete the empty file "wget" creates - wget -O "$suite/Release" "$snapshotUrl/dists/$suite/Release" - wget -O "$suite/Release.gpg" "$snapshotUrl/dists/$suite/Release.gpg" - fi - # TODO else extract InRelease contents somehow (no keyring here) fi done