diff options
author | Joey Hess <joey@kitenet.net> | 2011-01-26 15:37:16 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-01-26 15:37:16 -0400 |
commit | 268cb35e644754093db003aee08d050a1f3f9466 (patch) | |
tree | c00319c584a9ad020027eebc1af2e1a525a55473 /UUID.hs | |
parent | f7e3d6eea2f71efe14c3ccb29ef4e88840384d02 (diff) |
implement 3 level trust storage in trust.log
Diffstat (limited to 'UUID.hs')
-rw-r--r-- | UUID.hs | 30 |
1 files changed, 1 insertions, 29 deletions
@@ -17,10 +17,7 @@ module UUID ( reposWithoutUUID, prettyPrintUUIDs, describeUUID, - uuidLog, - trustLog, - getTrusted, - setTrusted + uuidLog ) where import Control.Monad.State @@ -141,28 +138,3 @@ uuidLog :: Annex FilePath uuidLog = do g <- Annex.gitRepo return $ gitStateDir g ++ "uuid.log" - -{- Filename of trust.log. -} -trustLog :: Annex FilePath -trustLog = do - g <- Annex.gitRepo - return $ gitStateDir g ++ "trust.log" - -{- List of trusted UUIDs. -} -getTrusted :: Annex [UUID] -getTrusted = do - logfile <- trustLog - s <- liftIO $ catch (readFile logfile) ignoreerror - return $ parse s - where - parse [] = [] - parse s = map firstword $ lines s - firstword [] = "" - firstword l = head $ words l - ignoreerror _ = return "" - -{- Changes the list of trusted UUIDs. -} -setTrusted :: [UUID] -> Annex () -setTrusted u = do - logfile <- trustLog - liftIO $ safeWriteFile logfile $ unlines u |