rename function

This commit is contained in:
Joey Hess 2016-05-27 13:10:23 -04:00
parent b7d47741c9
commit d2fa4a6873
Failed to extract signature

View file

@ -102,7 +102,7 @@ selectExtension f
where where
es = filter (not . null) $ reverse $ es = filter (not . null) $ reverse $
take 2 $ takeWhile shortenough $ take 2 $ takeWhile shortenough $
reverse $ split "." $ filter validExtension $ takeExtensions f reverse $ split "." $ filter validInExtension $ takeExtensions f
shortenough e = length e <= 4 -- long enough for "jpeg" shortenough e = length e <= 4 -- long enough for "jpeg"
{- A key's checksum is checked during fsck. -} {- A key's checksum is checked during fsck. -}
@ -133,8 +133,8 @@ checkKeyChecksum hash key file = catchIOErrorType HardwareFault hwfault $ do
keyHash :: Key -> String keyHash :: Key -> String
keyHash key = dropExtensions (keyName key) keyHash key = dropExtensions (keyName key)
validExtension :: Char -> Bool validInExtension :: Char -> Bool
validExtension c validInExtension c
| isAlphaNum c = True | isAlphaNum c = True
| c == '.' = True | c == '.' = True
| otherwise = False | otherwise = False
@ -143,7 +143,7 @@ validExtension c
- that contain non-alphanumeric characters in their extension. -} - that contain non-alphanumeric characters in their extension. -}
needsUpgrade :: Key -> Bool needsUpgrade :: Key -> Bool
needsUpgrade key = "\\" `isPrefixOf` keyHash key || needsUpgrade key = "\\" `isPrefixOf` keyHash key ||
any (not . validExtension) (takeExtensions $ keyName key) any (not . validInExtension) (takeExtensions $ keyName key)
trivialMigrate :: Key -> Backend -> AssociatedFile -> Maybe Key trivialMigrate :: Key -> Backend -> AssociatedFile -> Maybe Key
trivialMigrate oldkey newbackend afile trivialMigrate oldkey newbackend afile