From af04555ae6a8db726de48f87d11863fd966f58a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20S?= Date: Thu, 27 Jun 2019 15:16:07 +0200 Subject: [PATCH] Add IS_APT_VALID_UNTIL If you use archive.debian.org in sources.list you'll need `Acquire::Check-Valid-Until no;` set in apt config file, otherwise you'll have errors like: ``` E: Release file for http://archive.debian.org/debian/dists/jessie-backports/InRelease is expired (invalid since 44d 11h 3min 25s). Updates for this repository will not be applied. ``` --- evocheck.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/evocheck.sh b/evocheck.sh index 857b791..ad75f0b 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -1130,6 +1130,17 @@ check_osprober() { fi } +check_apt_valid_until() { + aptvalidFile="/etc/apt/apt.conf.d/99no-check-valid-until" + aptvalidText="Acquire::Check-Valid-Until no;" + if grep -qs "archive.debian.org" /etc/apt/sources.list /etc/apt/sources.list.d/*; then + if ! grep -qs "$aptvalidText" /etc/apt/apt.conf.d/*; then + failed "IS_APT_VALID_UNTIL" \ + "As you use archive.mirror.org you need ${aptvalidFile}: ${aptvalidText}" + fi + fi +} + main() { # Default return code : 0 = no error RC=0 @@ -1251,6 +1262,7 @@ main() { test "${IS_OLD_HOME_DIR:=1}" = 1 && check_old_home_dir test "${IS_EVOBACKUP_INCS:=1}" = 1 && check_evobackup_incs test "${IS_OSPROBER:=1}" = 1 && check_osprober + test "${IS_APT_VALID_UNTIL:=1}" = 1 && check_apt_valid_until fi #-----------------------------------------------------------