Closed anarcat closed 1 year ago
@julian-klode could you review this? I think it covers the comments you made in #182...
If APT::Periodic
is used at some point, and then disabled, wouldn't this report a false metric if apt
is updated in another manner?
On 2023-10-17 07:50:27, Jerome Charaoui wrote:
If
APT::Periodic
is used at some point, and then disabled, wouldn't this report a false metric ifapt
is updated in another manner?
If it's disabled, the code won't check that timestamp file, unless I got this wrong.
On 2023-10-17 07:50:27, Jerome Charaoui wrote: If
APT::Periodic
is used at some point, and then disabled, wouldn't this report a false metric ifapt
is updated in another manner? If it's disabled, the code won't check that timestamp file, unless I got this wrong.
Right, my bad!
I think you want to use get_b or what it's called in the config object that returns a boolean so that it parses everything correctly.
I think you want to use get_b or what it's called in the config object that returns a boolean so that it parses everything correctly.
It's a boolean? That wasn't quite clear to me, reading the documentation... I thought it could be a time delta (e.g. 1d
) as well, which is why I compare against "0"
, as a string.
Yes indeed, find_b sorry. Wasn't on my laptop so didn't look it up :)
thanks, fixed.
As reported in #182,
pkgcache.bin
gets updated on more than justapt update
. In particular, it gets modified when a package is installed, upgraded or removed.So let's fallback on a better heuristic, which is the
APT::Periodic
timestamp. This should give us a much more precise and deliberate status.We also fallback to the
lists
directory, which gets updated when new mirror lists gets moved into place. This does run the risk of staying silently unchanged if there's no change on mirrors but (a) that's rather infrequent and (b) we might actually want to warn on that anyway.Closes: #183