handle upgrading repositories initialized with --version=9

As was attempted earlier in the buggy commit 0d2e3058ee

Avoided the bug that had by making the upgrade log be updated after each
upgrade step. So, after upgrade from v8 to v9, the log is updated, and
so Upgrade.V9's timeOfUpgrade check will find that it was upgraded
recently and so won't let it skip ahead to v10.

Sponsored-by: k0ld on Patreon
This commit is contained in:
Joey Hess 2022-09-26 12:55:51 -04:00
parent 8230f4a6f1
commit e05dd70544
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 19 additions and 21 deletions

View file

@ -40,12 +40,13 @@ upgrade automatic
- and it is not safe for such to still be running after
- this upgrade. -}
oldprocessesdanger = timeOfUpgrade (RepoVersion 9) >>= \case
Nothing -> pure True
Just t -> do
now <- liftIO getPOSIXTime
if now < t + 365*24*60*60
then return True
else assistantrunning
-- Initialized at v9, so no old process danger exists.
Nothing -> pure False
{- Skip upgrade when git-annex assistant (or watch) is running,
- because these are long-running daemons that could conceivably