fix logic errors in code that determines if it's time for v10 upgrade

This would have prevented old git-annex from ever upgrading from v9 to
v10. Note that a manual `git-annex upgrade` can never run while the
assistant is running, so not <$> assistantrunning was always True,
so no matter what the timestamp of the v9 upgrade in the log, it would
decide there was old process danger.

Sponsored-by: Jack Hill on Patreon
This commit is contained in:
Joey Hess 2022-07-25 15:56:33 -04:00
parent a6ff335f0b
commit 61b55d62d7
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -43,9 +43,9 @@ upgrade automatic
Nothing -> pure True
Just t -> do
now <- liftIO getPOSIXTime
if now - 365*24*60*60 > t
if now < t + 365*24*60*60
then return True
else not <$> assistantrunning
else assistantrunning
{- Skip upgrade when git-annex assistant (or watch) is running,
- because these are long-running daemons that could conceivably