diff options
author | Joey Hess <joey@kitenet.net> | 2014-10-12 14:32:56 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-10-12 14:32:56 -0400 |
commit | efef527d5b2e42e261fa7af6947aad6553426ebe (patch) | |
tree | 082a5dad993557e9dffd76a69d4087371da8ed42 /Utility/Directory.hs | |
parent | ab1cf3570207bd08ae0abbba183a8c570c0361f5 (diff) | |
download | git-repair-efef527d5b2e42e261fa7af6947aad6553426ebe.tar.gz |
Merge from git-annex.
Includes changing to new exceptions library, and some whitespace fixes.
Diffstat (limited to 'Utility/Directory.hs')
-rw-r--r-- | Utility/Directory.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Utility/Directory.hs b/Utility/Directory.hs index ade5ef8..e4e4b80 100644 --- a/Utility/Directory.hs +++ b/Utility/Directory.hs @@ -11,7 +11,6 @@ module Utility.Directory where import System.IO.Error import System.Directory -import Control.Exception (throw, bracket) import Control.Monad import Control.Monad.IfElse import System.FilePath @@ -57,7 +56,7 @@ dirContentsRecursive = dirContentsRecursiveSkipping (const False) True dirContentsRecursiveSkipping :: (FilePath -> Bool) -> Bool -> FilePath -> IO [FilePath] dirContentsRecursiveSkipping skipdir followsubdirsymlinks topdir = go [topdir] where - go [] = return [] + go [] = return [] go (dir:dirs) | skipdir (takeFileName dir) = go dirs | otherwise = unsafeInterleaveIO $ do @@ -88,7 +87,7 @@ dirContentsRecursiveSkipping skipdir followsubdirsymlinks topdir = go [topdir] dirTreeRecursiveSkipping :: (FilePath -> Bool) -> FilePath -> IO [FilePath] dirTreeRecursiveSkipping skipdir topdir = go [] [topdir] where - go c [] = return c + go c [] = return c go c (dir:dirs) | skipdir (takeFileName dir) = go c dirs | otherwise = unsafeInterleaveIO $ do @@ -114,7 +113,7 @@ moveFile src dest = tryIO (rename src dest) >>= onrename whenM (isdir dest) rethrow viaTmp mv dest undefined where - rethrow = throw e + rethrow = throwM e mv tmp _ = do ok <- boolSystem "mv" [Param "-f", Param src, Param tmp] unless ok $ do |