diff options
author | Robby Workman <rworkman@slackware.com> | 2018-01-03 04:48:53 -0600 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2018-01-03 04:48:53 -0600 |
commit | 4e7a7c9ebbc67037a1c6ef47dda8c4264aaa1a42 (patch) | |
tree | 528f6b6214f56eec4461c628f1febc98c457488c /files | |
parent | d426faa6e7408ac0fee01e8564e482e6396d26ff (diff) | |
download | slackpkg-4e7a7c9ebbc67037a1c6ef47dda8c4264aaa1a42.tar.xz |
slackpkg: Abort if system date is near epoch
This merges slackpkg-quit-on-epoch.patch from Slackware ARM
Diffstat (limited to 'files')
-rw-r--r-- | files/slackpkg | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/files/slackpkg b/files/slackpkg index cec2ddd..1fa7b3e 100644 --- a/files/slackpkg +++ b/files/slackpkg @@ -22,6 +22,23 @@ # 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 #======================================================================== # |