uuid type

This commit is contained in:
Joey Hess 2010-10-12 15:48:00 -04:00
parent e53900a545
commit d257bad93c
2 changed files with 5 additions and 3 deletions

View file

@ -102,7 +102,7 @@ annexGetFile state file = do
annexWantFile :: State -> FilePath -> IO () annexWantFile :: State -> FilePath -> IO ()
annexWantFile state file = do error "not implemented" -- TODO annexWantFile state file = do error "not implemented" -- TODO
{- Indicates a file is now wanted. -} {- Indicates a file is not wanted. -}
annexDropFile :: State -> FilePath -> IO () annexDropFile :: State -> FilePath -> IO ()
annexDropFile state file = do error "not implemented" -- TODO annexDropFile state file = do error "not implemented" -- TODO

View file

@ -15,16 +15,18 @@ import System.Cmd.Utils
import System.IO import System.IO
import GitRepo import GitRepo
type UUID = String
configkey="annex.uuid" configkey="annex.uuid"
{- Generates a UUID. There is a library for this, but it's not packaged, {- Generates a UUID. There is a library for this, but it's not packaged,
- so use the command line tool. -} - so use the command line tool. -}
genUUID :: IO String genUUID :: IO UUID
genUUID = do genUUID = do
pOpen ReadFromPipe "uuid" ["-m"] $ \h -> hGetLine h pOpen ReadFromPipe "uuid" ["-m"] $ \h -> hGetLine h
{- Looks up a repo's UUID -} {- Looks up a repo's UUID -}
getUUID :: GitRepo -> String getUUID :: GitRepo -> UUID
getUUID repo = gitConfig repo "annex.uuid" "" getUUID repo = gitConfig repo "annex.uuid" ""
{- Make sure that the repo has an annex.uuid setting. -} {- Make sure that the repo has an annex.uuid setting. -}