Unverified Commit 6f5e46c2 authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

reproducible: actually, keep the real_year real, and deal with Dec/Jan which...


reproducible: actually, keep the real_year real, and deal with Dec/Jan which are special months for us

The future hosts are 1 year and 1 month (and 1 day) in the future,
therefore where we are in December of year X the future hosts will be in
January of year X+2.

This will still leave a single day of warnings during December 31 (I think).

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 096ee89f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -107,13 +107,14 @@ fi
# (XXX: yes this is hardcoded but meh…)
echo "$(date -u) - testing whether the time is right..."
get_node_ssh_port "$HOSTNAME"
real_year=2019
real_year=2018
year=$(date +%Y)
if "$NODE_RUN_IN_THE_FUTURE"; then
	if [ "$year" -eq "$real_year" ]; then
		echo "Warning, today we came back to the present: $(date -u)."
		DIRTY=true
	elif [ "$year" -eq $(( $real_year + 1 )) ] ; then
	elif [ "$year" -eq "$(("$real_year" + 1))" ] || \
		 [ "$year" -eq "$(("$real_year" + 2))" -a "$(date +%m)" -eq 1]; then
		echo "Good, today is the right future: $(date -u)."
	else
		echo "Warning, today is the wrong future: $(date -u)."