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:
parent
634a485b50
commit
27eca014be
6 changed files with 59 additions and 21 deletions
|
@ -16,8 +16,7 @@ import Control.Concurrent
|
|||
import Control.Applicative
|
||||
import Prelude
|
||||
|
||||
{- Enough information to uniquely identify a transfer, used as the filename
|
||||
- of the transfer information file. -}
|
||||
{- Enough information to uniquely identify a transfer. -}
|
||||
data Transfer = Transfer
|
||||
{ transferDirection :: Direction
|
||||
, transferUUID :: UUID
|
||||
|
@ -46,7 +45,16 @@ stubTransferInfo :: TransferInfo
|
|||
stubTransferInfo = TransferInfo Nothing Nothing Nothing Nothing Nothing Nothing False
|
||||
|
||||
data Direction = Upload | Download
|
||||
deriving (Eq, Ord, Read, Show)
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
formatDirection :: Direction -> String
|
||||
formatDirection Upload = "upload"
|
||||
formatDirection Download = "download"
|
||||
|
||||
parseDirection :: String -> Maybe Direction
|
||||
parseDirection "upload" = Just Upload
|
||||
parseDirection "download" = Just Download
|
||||
parseDirection _ = Nothing
|
||||
|
||||
instance Arbitrary TransferInfo where
|
||||
arbitrary = TransferInfo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue