Skip to content

Commit 2bdf063

Browse files
committed
config/hooks/GRMLBASE/updatebase: fix duplicate Check-Valid-Until
* If the class RELEASE is enabled (which is now default) and we use the waybackmachine the sources.list(5) entry 'Check-Valid-Until' will be taken care by config/scripts/GRMLBASE/33-aptsetup
1 parent 8fdc382 commit 2bdf063

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

config/hooks/GRMLBASE/updatebase

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ if [ -n "${WAYBACK_DATE:-}" ] ; then
3838
s#^(URIs:)\s+(.*://deb.debian.org/)(.*)\/?$#$1 http://snapshot.debian.org/archive/$3/$d#' \
3939
"${target}"/etc/apt/sources.list.d/debian.sources
4040

41-
sed -i '/^Types:/a Check-Valid-Until: no' "${target}"/etc/apt/sources.list.d/debian.sources
41+
# config/scripts/GRMLBASE/33-aptsetup will already apply this when class
42+
# RELEASE is enabled (default).
43+
if ! ifclass RELEASE; then
44+
sed -i '/^Types:/a Check-Valid-Until: no' "${target}"/etc/apt/sources.list.d/debian.sources
45+
fi
4246
fi
4347

4448
## END OF FILE #################################################################

config/scripts/GRMLBASE/33-aptsetup

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ set -u
1616
target=${target:?}
1717

1818
# use snapshot.debian.org based on build date for release
19-
if ifclass RELEASE ; then
19+
if ifclass RELEASE; then
2020
current_date=$(date --utc -d "@${SOURCE_DATE_EPOCH}" +%Y%m%d)
2121
perl -pi -e 'BEGIN { $d="'"$current_date"'"; } \
2222
s#^(URIs:)\s+(.*://deb.debian.org/)(.*)\/?$#$1 http://snapshot.debian.org/archive/$3/$d#' \
2323
"${target}"/etc/apt/sources.list.d/debian.sources
2424

2525
sed -i '/^Types:/a Check-Valid-Until: no' "${target}"/etc/apt/sources.list.d/debian.sources
2626
fi
27-
2827
## END OF FILE #################################################################
2928
# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2

0 commit comments

Comments
 (0)