aboutsummaryrefslogtreecommitdiff
path: root/Logs/Unused.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2018-01-02 17:17:10 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2018-01-02 17:25:25 -0400
commited2c1839fd8e0616165de569cff939dc3bf6527d (patch)
tree7dd4eed72c8a32ccd53f8bb75620e205eba514a5 /Logs/Unused.hs
parent2c16edc58f1f549cd4e5611c0f7c45fec6b66da0 (diff)
Fix several places where files in .git/annex/ were written with modes that did not take the core.sharedRepository config into account.
git grep writeFile finds some more that might also be problems, but for now I've concentrated on .git/annex/ log files. There are certianly cases where writeFile is not a problem too. This commit was sponsored by mo on Patreon.
Diffstat (limited to 'Logs/Unused.hs')
-rw-r--r--Logs/Unused.hs8
1 files changed, 2 insertions, 6 deletions
diff --git a/Logs/Unused.hs b/Logs/Unused.hs
index 076245591..d76d19a56 100644
--- a/Logs/Unused.hs
+++ b/Logs/Unused.hs
@@ -33,9 +33,8 @@ import Data.Time
import Annex.Common
import qualified Annex
-import Annex.Perms
-import Utility.Tmp
import Logs.TimeStamp
+import Logs.File
-- everything that is stored in the unused log
type UnusedLog = M.Map Key (Int, Maybe POSIXTime)
@@ -65,13 +64,10 @@ updateUnusedLog prefix m = do
writeUnusedLog :: FilePath -> UnusedLog -> Annex ()
writeUnusedLog prefix l = do
logfile <- fromRepo $ gitAnnexUnusedLog prefix
- viaTmp writelog logfile $ unlines $ map format $ M.toList l
+ writeLogFile logfile $ unlines $ map format $ M.toList l
where
format (k, (i, Just t)) = show i ++ " " ++ key2file k ++ " " ++ show t
format (k, (i, Nothing)) = show i ++ " " ++ key2file k
- writelog f c = do
- liftIO $ writeFile f c
- setAnnexFilePerm f
readUnusedLog :: FilePath -> Annex UnusedLog
readUnusedLog prefix = do