2424# - debian:11 (/etc/apt/sources.list)
2525# - debian:12 (/etc/apt/sources.list.d/debian.sources)
2626# - ubuntu:22.04 (/etc/apt/sources.list)
27- # - ubuntu:23.10 (/etc/apt/sources.list )
27+ # - ubuntu:24.04 (/etc/apt/sources.listd/ubuntu.sources )
2828# - archlinux (/etc/pacman.d/mirrorlist)
2929#
3030# For the further information, see https://github.com/reproducible-containers/repro-sources-list.sh
@@ -46,15 +46,12 @@ case "${ID}" in
4646 # : "${SNAPSHOT_ARCHIVE_BASE:=http://snapshot.debian.org/archive/}"
4747 : " ${SNAPSHOT_ARCHIVE_BASE:= http:// snapshot-cloudflare.debian.org/ archive/ } "
4848 : " ${BACKPORTS:= } "
49- case " ${VERSION_ID} " in
50- " 10" | " 11" )
51- : " ${SOURCE_DATE_EPOCH:= $(stat --format=% Y / etc/ apt/ sources.list)} "
52- ;;
53- * )
49+ if [ -e /etc/apt/sources.list.d/debian.sources ]; then
5450 : " ${SOURCE_DATE_EPOCH:= $(stat --format=% Y / etc/ apt/ sources.list.d/ debian.sources)} "
5551 rm -f /etc/apt/sources.list.d/debian.sources
56- ;;
57- esac
52+ else
53+ : " ${SOURCE_DATE_EPOCH:= $(stat --format=% Y / etc/ apt/ sources.list)} "
54+ fi
5855 snapshot=" $( printf " %(%Y%m%dT%H%M%SZ)T\n" " ${SOURCE_DATE_EPOCH} " ) "
5956 # TODO: use the new format for Debian >= 12
6057 echo " deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE} debian/${snapshot} ${VERSION_CODENAME} main" > /etc/apt/sources.list
@@ -65,8 +62,14 @@ case "${ID}" in
6562 ;;
6663" ubuntu" )
6764 : " ${SNAPSHOT_ARCHIVE_BASE:= http:// snapshot.ubuntu.com/ } "
68- : " ${SOURCE_DATE_EPOCH:= $(stat --format=% Y / etc/ apt/ sources.list)} "
65+ if [ -e /etc/apt/sources.list.d/ubuntu.sources ]; then
66+ : " ${SOURCE_DATE_EPOCH:= $(stat --format=% Y / etc/ apt/ sources.list.d/ ubuntu.sources)} "
67+ rm -f /etc/apt/sources.list.d/ubuntu.sources
68+ else
69+ : " ${SOURCE_DATE_EPOCH:= $(stat --format=% Y / etc/ apt/ sources.list)} "
70+ fi
6971 snapshot=" $( printf " %(%Y%m%dT%H%M%SZ)T\n" " ${SOURCE_DATE_EPOCH} " ) "
72+ # TODO: use the new format for Ubuntu >= 24.04
7073 echo " deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE} ubuntu/${snapshot} ${VERSION_CODENAME} main restricted" > /etc/apt/sources.list
7174 echo " deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE} ubuntu/${snapshot} ${VERSION_CODENAME} -updates main restricted" >> /etc/apt/sources.list
7275 echo " deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE} ubuntu/${snapshot} ${VERSION_CODENAME} universe" >> /etc/apt/sources.list
0 commit comments