1
0
Files
electrum/contrib/freeze_containers_distro.sh
SomberNight 52b03e1f78 win build: use of debian unstable snapshots needs check-valid-until=no
see https://snapshot.debian.org/
>  To access snapshots of suites using Valid-Until that are older than a dozen days, it is necessary to ignore the Valid-Until header within Release files, in order to prevent apt from disregarding snapshot entries ("Release file expired"). Use aptitude -o Acquire::Check-Valid-Until=false update or apt-get -o Acquire::Check-Valid-Until=false update for this purpose.

(thanks to Axel Gembe for pointing this out)
2022-09-27 11:56:43 +00:00

49 lines
1.9 KiB
Bash
Executable File

#!/bin/sh
# Run this after a new release to update pin for build container distro packages
set -e
DEBIAN_SNAPSHOT_BASE="https://snapshot.debian.org/archive/debian/"
DEBIAN_APPIMAGE_DISTRO="buster" # should match build-linux/appimage Dockerfile base
DEBIAN_WINE_DISTRO="bullseye" # should match build-wine Dockerfile base
DEBIAN_ANDROID_DISTRO="bullseye" # should match android Dockerfile base
contrib=$(dirname "$0")
if [ ! -x /bin/wget ]; then
echo "no wget"
exit 1
fi
DEBIAN_SNAPSHOT_LATEST=$(wget -O- ${DEBIAN_SNAPSHOT_BASE}$(date +"?year=%Y&month=%m") 2>/dev/null|grep "^<a href=\"20"|tail -1|sed -e 's#[^"]*"\(.\{17,17\}\).*#\1#')
if [ "${DEBIAN_SNAPSHOT_LATEST}x" = "x" ]; then
echo "could not find timestamp for debian packages"
exit 1
fi
DEBIAN_SNAPSHOT=${DEBIAN_SNAPSHOT_BASE}${DEBIAN_SNAPSHOT_LATEST}
echo "Checking if URL valid.."
wget -O /dev/null ${DEBIAN_SNAPSHOT} 2>/dev/null
echo "Valid!"
# build-linux
echo "deb ${DEBIAN_SNAPSHOT} ${DEBIAN_APPIMAGE_DISTRO} main non-free contrib" >$contrib/build-linux/appimage/apt.sources.list
echo "deb-src ${DEBIAN_SNAPSHOT} ${DEBIAN_APPIMAGE_DISTRO} main non-free contrib" >>$contrib/build-linux/appimage/apt.sources.list
# build-wine
echo "deb ${DEBIAN_SNAPSHOT} ${DEBIAN_WINE_DISTRO} main non-free contrib" >$contrib/build-wine/apt.sources.list
echo "deb-src ${DEBIAN_SNAPSHOT} ${DEBIAN_WINE_DISTRO} main non-free contrib" >>$contrib/build-wine/apt.sources.list
# we need win-iconv-mingw-w64-dev which is only in sid/unstable
echo "deb [check-valid-until=no] ${DEBIAN_SNAPSHOT} unstable main non-free contrib" >>$contrib/build-wine/apt.sources.list
# android
echo "deb ${DEBIAN_SNAPSHOT} ${DEBIAN_ANDROID_DISTRO} main non-free contrib" >$contrib/android/apt.sources.list
echo "deb-src ${DEBIAN_SNAPSHOT} ${DEBIAN_ANDROID_DISTRO} main non-free contrib" >>$contrib/android/apt.sources.list
echo "updated APT sources to ${DEBIAN_SNAPSHOT}"