diff options
author | Joey Hess <joey@kitenet.net> | 2011-07-01 01:11:41 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-07-01 01:11:41 -0400 |
commit | ceb887d82669b3ec694f31a899b59eefe0f5f352 (patch) | |
tree | 16f93c8f04cd4cd933e42182c7482dcaa195ca9c | |
parent | b9721fffac0815fcb9c69cca6b9ef2c7982438e7 (diff) |
tweaks
-rw-r--r-- | Content.hs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Content.hs b/Content.hs index d24fc9ac7..937ebd542 100644 --- a/Content.hs +++ b/Content.hs @@ -235,10 +235,11 @@ moveBad key = do g <- Annex.gitRepo let src = gitAnnexLocation g key let dest = gitAnnexBadDir g </> takeFileName src - liftIO $ createDirectoryIfMissing True (parentDir dest) - liftIO $ allowWrite (parentDir src) - liftIO $ renameFile src dest - liftIO $ removeDirectory (parentDir src) + liftIO $ do + createDirectoryIfMissing True (parentDir dest) + allowWrite (parentDir src) + renameFile src dest + removeDirectory (parentDir src) logStatus key ValueMissing return dest @@ -252,12 +253,12 @@ getKeysPresent' dir = do exists <- liftIO $ doesDirectoryExist dir if (not exists) then return [] - else do + else liftIO $ do -- 2 levels of hashing - levela <- liftIO $ dirContents dir - levelb <- liftIO $ mapM dirContents levela - contents <- liftIO $ mapM dirContents (concat levelb) - files <- liftIO $ filterM present (concat contents) + levela <- dirContents dir + levelb <- mapM dirContents levela + contents <- mapM dirContents (concat levelb) + files <- filterM present (concat contents) return $ catMaybes $ map (fileKey . takeFileName) files where present d = do |