Skip to content

Commit d4acf2d

Browse files
authored
Merge pull request #688 from Dstack-TEE/fix/builder-pinned-packages
chore(ci): bump builder pinned packages for Debian upstream drift
2 parents ae43fb5 + 6a87118 commit d4acf2d

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

build/shared/pin-packages.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,25 @@ if [ -z "$PKG_LIST" ]; then
2222
exit 1
2323
fi
2424

25-
echo "deb [check-valid-until=no] http://snapshot.debian.org/archive/debian/${SNAPSHOT_DATE} bookworm main" > /etc/apt/sources.list
26-
echo "deb [check-valid-until=no] http://snapshot.debian.org/archive/debian-security/${SNAPSHOT_DATE} bookworm-security main" >> /etc/apt/sources.list
25+
# Detect base image suite (e.g. bookworm, trixie). Different Debian releases
26+
# ship different sources layouts (legacy sources.list vs deb822
27+
# sources.list.d/*.sources), so we must wipe both and rewrite from scratch
28+
# pointing at the frozen snapshot for this exact suite. Otherwise the base
29+
# image's default live sources stay active and packages drift on every build.
30+
# shellcheck source=/dev/null
31+
SUITE=$(. /etc/os-release && echo "${VERSION_CODENAME:-}")
32+
if [ -z "$SUITE" ]; then
33+
echo "could not detect Debian suite from /etc/os-release" >&2
34+
exit 1
35+
fi
36+
37+
rm -f /etc/apt/sources.list
38+
rm -f /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources
39+
40+
cat > /etc/apt/sources.list <<EOF
41+
deb [check-valid-until=no] http://snapshot.debian.org/archive/debian/${SNAPSHOT_DATE} ${SUITE} main
42+
deb [check-valid-until=no] http://snapshot.debian.org/archive/debian-security/${SNAPSHOT_DATE} ${SUITE}-security main
43+
EOF
2744
echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/10no-check-valid-until
2845

2946
mkdir -p /etc/apt/preferences.d

0 commit comments

Comments
 (0)