fix up Read instance incompatability caused by recent commit

9c4650358c changed the Read instance for
Key.

I've checked all uses of that instance (by removing it and seeing what
breaks), and they're all limited to the webapp, except one.
That is GitAnnexDistribution's Read instance.

So, 9c4650358c would have broken upgrades
of git-annex from downloads.kitenet.net. Once the .info files there got
updated for a new release, old releases would have failed to parse them
and never upgraded.

To fix this, I found a way to make the .info files that contain
GitAnnexDistribution values be readable by the old version of git-annex.

This commit was sponsored by Ewen McNeill.
This commit is contained in:
Joey Hess 2017-02-24 18:51:57 -04:00
parent 634a485b50
commit 27eca014be
No known key found for this signature in database
GPG key ID: C910D9222512E3C7
6 changed files with 59 additions and 21 deletions

View file

@ -119,13 +119,14 @@ makeinfos updated version = do
Just k -> whenM (inAnnex k) $ do
liftIO $ putStrLn f
let infofile = f ++ ".info"
liftIO $ writeFile infofile $ show $ GitAnnexDistribution
let d = GitAnnexDistribution
{ distributionUrl = mkUrl f
, distributionKey = k
, distributionVersion = bv
, distributionReleasedate = now
, distributionUrgentUpgrade = Nothing
}
liftIO $ writeFile infofile $ formatInfoFile d
void $ inRepo $ runBool [Param "add", File infofile]
signFile infofile
signFile f