Offline build fails when the InRelease file gets too old
Originally created by @arnaud on #12452 (Redmine)
When doing offline builds, no downloads are performed, and instead files
are taken from the cache of apt-cacher-ng
.
Some of these files have an expiry date, as you can see in the VM with this command:
grep -rn Valid-Until /var/cache/apt-cacher-ng/
Different files have different expiry dates. As a consequence, offline
builds fail after a few days, because ‘apt-get update
’ returns this
kind of errors:
E: Release file for http://ftp.us.debian.org/debian/dists/jessie-backports/InRelease is expired (invalid since 2d 0h 22min 54s). Updates for this repository will not be applied.
My first attempt to solve that is to tell apt to ignore the expiry date. I attach the patch so that you get the idea.
It worked for me, but I don’t think it works in every situation. Here I
just patched the file ‘setup-tails-builder
’, but the truth is that
there are ‘apt-get update
’ scattered all along the build process, and
my patch doesn’t address them. So there will be situation where the
build will fail even with this patch.
I’m not sure that it’s a good idea to modify every file where ‘apt-get update
’ is involved. It seems a bit messy, and I have no idea if the
environment variable ‘TAILS_OFFLINE_MODE
’ is propagated into the
chroot.
Feature Branch: wip/12452-ignore-apt-valid-until-build-option