git-annex/Backend/Worm.hs

19 lines
424 B
Haskell
Raw Normal View History

2010-10-15 20:42:36 +00:00
{- git-annex "WORM" backend -- Write Once, Read Many
- -}
module Backend.Worm (backend) where
import qualified Backend.File
import BackendTypes
2010-10-15 20:52:47 +00:00
import Utility
import System.FilePath
2010-10-15 20:42:36 +00:00
backend = Backend.File.backend {
name = "WORM",
getKey = keyValue
}
2010-10-15 20:52:47 +00:00
-- direct mapping from basename of filename to key
2010-10-15 20:42:36 +00:00
keyValue :: FilePath -> Annex (Maybe Key)
2010-10-15 20:52:47 +00:00
keyValue file = return $ Just $ Key ((name backend), (takeFileName file))