make everything build again after ByteString Key changes
This commit is contained in:
parent
151562b537
commit
727767e1e2
23 changed files with 79 additions and 72 deletions
|
@ -14,6 +14,8 @@ import Types.KeySource
|
|||
import Backend.Utilities
|
||||
import Git.FilePath
|
||||
|
||||
import qualified Data.ByteString.Char8 as S8
|
||||
|
||||
backends :: [Backend]
|
||||
backends = [backend]
|
||||
|
||||
|
@ -45,12 +47,12 @@ keyValue source = do
|
|||
|
||||
{- Old WORM keys could contain spaces, and can be upgraded to remove them. -}
|
||||
needsUpgrade :: Key -> Bool
|
||||
needsUpgrade key = ' ' `elem` keyName key
|
||||
needsUpgrade key = ' ' `S8.elem` keyName key
|
||||
|
||||
removeSpaces :: Key -> Backend -> AssociatedFile -> Annex (Maybe Key)
|
||||
removeSpaces oldkey newbackend _
|
||||
| migratable = return $ Just $ oldkey
|
||||
{ keyName = reSanitizeKeyName (keyName oldkey) }
|
||||
{ keyName = encodeBS $ reSanitizeKeyName $ decodeBS $ keyName oldkey }
|
||||
| otherwise = return Nothing
|
||||
where
|
||||
migratable = oldvariety == newvariety
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue