diff --git a/Annex/Content.hs b/Annex/Content.hs index 0b665d4dcc..2ba3871051 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -50,6 +50,7 @@ module Annex.Content ( ) where import System.IO.Unsafe (unsafeInterleaveIO) +import System.PosixCompat.Files import qualified Data.Set as S import Annex.Common @@ -84,7 +85,6 @@ import Types.Key import Annex.UUID import Annex.InodeSentinal import Utility.InodeCache -import Utility.PosixFiles {- Checks if a given key's content is currently present. -} inAnnex :: Key -> Annex Bool diff --git a/Annex/Fixup.hs b/Annex/Fixup.hs index 6a14f22bc9..4b5149d0ab 100644 --- a/Annex/Fixup.hs +++ b/Annex/Fixup.hs @@ -15,11 +15,11 @@ import qualified Git.BuildVersion import Utility.Path import Utility.SafeCommand import Utility.Directory -import Utility.PosixFiles import Utility.Exception import System.IO import System.FilePath +import System.PosixCompat.Files import Data.List import Control.Monad import Control.Monad.IfElse diff --git a/Common.hs b/Common.hs index ba8382613b..8ff1b718ae 100644 --- a/Common.hs +++ b/Common.hs @@ -18,6 +18,7 @@ import System.IO as X hiding (FilePath) import System.Posix.IO as X hiding (createPipe) #endif import System.Exit as X +import System.PosixCompat.Files as X hiding (fileSize) import Utility.Misc as X import Utility.Exception as X @@ -28,7 +29,6 @@ import Utility.Directory as X import Utility.Monad as X import Utility.Data as X import Utility.Applicative as X -import Utility.PosixFiles as X hiding (fileSize) import Utility.FileSize as X import Utility.Network as X import Utility.Split as X diff --git a/Utility/DirWatcher/Win32Notify.hs b/Utility/DirWatcher/Win32Notify.hs index 3428f3db37..a2f40128fb 100644 --- a/Utility/DirWatcher/Win32Notify.hs +++ b/Utility/DirWatcher/Win32Notify.hs @@ -11,7 +11,7 @@ import Common hiding (isDirectory) import Utility.DirWatcher.Types import System.Win32.Notify -import qualified Utility.PosixFiles as Files +import qualified System.PosixCompat.Files as Files watchDir :: FilePath -> (FilePath -> Bool) -> Bool -> WatchHooks -> IO WatchManager watchDir dir ignored scanevents hooks = do diff --git a/Utility/Directory.hs b/Utility/Directory.hs index c24f36da56..895581dff1 100644 --- a/Utility/Directory.hs +++ b/Utility/Directory.hs @@ -16,6 +16,7 @@ module Utility.Directory ( import System.IO.Error import Control.Monad import System.FilePath +import System.PosixCompat.Files import Control.Applicative import Control.Concurrent import System.IO.Unsafe (unsafeInterleaveIO) @@ -31,7 +32,6 @@ import Control.Monad.IfElse #endif import Utility.SystemDirectory -import Utility.PosixFiles import Utility.Tmp import Utility.Exception import Utility.Monad diff --git a/Utility/FileMode.hs b/Utility/FileMode.hs index d9a269448f..370bcf62da 100644 --- a/Utility/FileMode.hs +++ b/Utility/FileMode.hs @@ -15,7 +15,7 @@ module Utility.FileMode ( import System.IO import Control.Monad import System.PosixCompat.Types -import Utility.PosixFiles +import System.PosixCompat.Files #ifndef mingw32_HOST_OS import System.Posix.Files import Control.Monad.IO.Class (liftIO) diff --git a/Utility/PosixFiles.hs b/Utility/PosixFiles.hs deleted file mode 100644 index 37253da29b..0000000000 --- a/Utility/PosixFiles.hs +++ /dev/null @@ -1,42 +0,0 @@ -{- POSIX files (and compatablity wrappers). - - - - This is like System.PosixCompat.Files, but with a few fixes. - - - - Copyright 2014 Joey Hess - - - - License: BSD-2-clause - -} - -{-# LANGUAGE CPP #-} -{-# OPTIONS_GHC -fno-warn-tabs #-} - -module Utility.PosixFiles ( - module X, - rename -) where - -import System.PosixCompat.Files as X hiding (rename) - -#ifndef mingw32_HOST_OS -import System.Posix.Files (rename) -#else -import qualified System.Win32.File as Win32 -import qualified System.Win32.HardLink as Win32 -#endif - -{- System.PosixCompat.Files.rename on Windows calls renameFile, - - so cannot rename directories. - - - - Instead, use Win32 moveFile, which can. It needs to be told to overwrite - - any existing file. -} -#ifdef mingw32_HOST_OS -rename :: FilePath -> FilePath -> IO () -rename src dest = Win32.moveFileEx src dest Win32.mOVEFILE_REPLACE_EXISTING -#endif - -{- System.PosixCompat.Files.createLink throws an error, but windows - - does support hard links. -} -#ifdef mingw32_HOST_OS -createLink :: FilePath -> FilePath -> IO () -createLink = Win32.createHardLink -#endif diff --git a/Utility/Tmp.hs b/Utility/Tmp.hs index ca611e0b4c..7255c141e5 100644 --- a/Utility/Tmp.hs +++ b/Utility/Tmp.hs @@ -15,13 +15,13 @@ import Control.Monad.IfElse import System.FilePath import System.Directory import Control.Monad.IO.Class +import System.PosixCompat.Files #ifndef mingw32_HOST_OS import System.Posix.Temp (mkdtemp) #endif import Utility.Exception import Utility.FileSystemEncoding -import Utility.PosixFiles type Template = String diff --git a/git-annex.cabal b/git-annex.cabal index f16e682cfb..3363d12a8e 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -380,7 +380,11 @@ Executable git-annex Build-Depends: network (< 2.6), network (>= 2.4) if (os(windows)) - Build-Depends: Win32 (== 2.3.1.1), Win32-extras, unix-compat (>= 0.4.1.3), setenv, + Build-Depends: + Win32 (== 2.3.1.1), + Win32-extras, + unix-compat (>= 0.5), + setenv, process (>= 1.4.2.0) else Build-Depends: unix @@ -1026,7 +1030,6 @@ Executable git-annex Utility.PartialPrelude Utility.Path Utility.Percentage - Utility.PosixFiles Utility.Process Utility.Process.Shim Utility.QuickCheck