summaryrefslogtreecommitdiff
path: root/UUID.hs
diff options
context:
space:
mode:
Diffstat (limited to 'UUID.hs')
-rw-r--r--UUID.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/UUID.hs b/UUID.hs
index 40c2330ee..4364e2070 100644
--- a/UUID.hs
+++ b/UUID.hs
@@ -15,16 +15,18 @@ import System.Cmd.Utils
import System.IO
import GitRepo
+type UUID = String
+
configkey="annex.uuid"
{- Generates a UUID. There is a library for this, but it's not packaged,
- so use the command line tool. -}
-genUUID :: IO String
+genUUID :: IO UUID
genUUID = do
pOpen ReadFromPipe "uuid" ["-m"] $ \h -> hGetLine h
{- Looks up a repo's UUID -}
-getUUID :: GitRepo -> String
+getUUID :: GitRepo -> UUID
getUUID repo = gitConfig repo "annex.uuid" ""
{- Make sure that the repo has an annex.uuid setting. -}