#!/bin/bash

## Copyright (C) 2026 - 2026 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

set -o errexit
set -o nounset
set -o pipefail
set -o errtrace
shopt -s inherit_errexit
shopt -s shift_verbose

## Both frozen-snapshot-timestamp and dm-frozen.sources are provided at
## /etc/apt/ by the Dockerfile.
sed -i "s/XXX_TS_XXX/$(date --utc --date="@$(cat /etc/apt/frozen-snapshot-timestamp)" '+%Y%m%dT%H%M%SZ')/g" /etc/apt/dm-frozen.sources

## We load the timestamp from frozen-snapshot-timestamp within the source tree
## when using the container, so we don't need the extra copy anymore.
rm -f -- /etc/apt/frozen-snapshot-timestamp
