slackpkg: Abort if system date is near epoch

This merges slackpkg-quit-on-epoch.patch from Slackware ARM
This commit is contained in:
Robby Workman 2018-01-03 04:48:53 -06:00
parent d426faa6e7
commit 4e7a7c9ebb

View file

@ -22,6 +22,23 @@
# Evaldo Gardenali (aka UdontKnow) evaldogardenali@fasternet.com.br # Evaldo Gardenali (aka UdontKnow) evaldogardenali@fasternet.com.br
# #
# Ensure that we're not at the epoch. slackpkg breaks with GPG checks when
# the date is so far in the past:
if [ $( date +%s ) -le 1437841588 ]; then
cat <<"EOF"
Error: Your system date is wrong. slackpkg requires that the date be correct
so that the package signatures can be verified.
The date may be incorrect because you have a system such as a Raspberry Pi that
does does not have an RTC (Real Time Clock), or that the correct date was unable
to be read from the RTC due to a driver bug, or a missing driver.
You may wish to set up NTP on your system:
http://docs.slackware.com/howtos:network_services:ntp
EOF
exit 1
fi
#======================================================================== #========================================================================
# #