The tests changes the sources.list and the modification time of this
file is considered while figuring out if the cache can be good. Usually
this isn't an issue, but in that case we have the cache generation
produce warnings which appear twice in this case.
(cherry picked from commit 70bef3257a4dc7751444db8dadedd207bd24ab35)
(cherry picked from commit 1cbb4c95f3fdd0872a7f1cb0f970f50a68c13959)
Oddly enough, we need to change the order of adding compressors
in aptconfiguration.cc, or test-compressed-indexes failed. Maybe
1.6.y and later actually sort by cost, idk.
This was introduced by the pattern backport, because sources.list
parsing errors are fatal, so GetDepCache() and GetPkgCache() both
tried to read the sources.list and failed.
Use BuildDepCache instead, and fail early if we can't open it.