diff --git a/Annex/Action.hs b/Annex/Action.hs index 5c3bf6ca80..641a184e62 100644 --- a/Annex/Action.hs +++ b/Annex/Action.hs @@ -27,8 +27,8 @@ import Annex.CheckIgnore import Annex.TransferrerPool import qualified Database.Keys -import Control.Concurrent.STM #ifndef mingw32_HOST_OS +import Control.Concurrent.STM import System.Posix.Signals #endif diff --git a/Annex/Init.hs b/Annex/Init.hs index 1220c2e58e..860206c604 100644 --- a/Annex/Init.hs +++ b/Annex/Init.hs @@ -51,10 +51,10 @@ import Annex.InodeSentinal import Upgrade import Annex.Tmp import Utility.UserInfo -import qualified Utility.RawFilePath as R -import Utility.ThreadScheduler import Annex.Perms #ifndef mingw32_HOST_OS +import Utility.ThreadScheduler +import qualified Utility.RawFilePath as R import Utility.FileMode import System.Posix.User import qualified Utility.LockFile.Posix as Posix @@ -62,8 +62,8 @@ import qualified Utility.LockFile.Posix as Posix import qualified Data.Map as M import Control.Monad.IO.Class (MonadIO) -import System.PosixCompat.Files (ownerReadMode, isNamedPipe) #ifndef mingw32_HOST_OS +import System.PosixCompat.Files (ownerReadMode, isNamedPipe) import Data.Either import qualified System.FilePath.ByteString as P import Control.Concurrent.Async diff --git a/Annex/Link.hs b/Annex/Link.hs index 9c75a8b728..4ef0a12689 100644 --- a/Annex/Link.hs +++ b/Annex/Link.hs @@ -43,7 +43,9 @@ import qualified Data.ByteString as S import qualified Data.ByteString.Char8 as S8 import qualified Data.ByteString.Lazy as L import qualified System.FilePath.ByteString as P +#ifndef mingw32_HOST_OS import System.PosixCompat.Files (isSymbolicLink) +#endif type LinkTarget = S.ByteString diff --git a/Command/Fsck.hs b/Command/Fsck.hs index dd48c98680..8485f33ebb 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -16,11 +16,13 @@ import qualified Remote import qualified Types.Backend import qualified Backend import Annex.Content +#ifndef mingw32_HOST_OS +import Annex.Version import Annex.Content.Presence +#endif import Annex.Content.Presence.LowLevel import Annex.Perms import Annex.Link -import Annex.Version import Logs.Location import Logs.Trust import Logs.Activity diff --git a/Command/RemoteDaemon.hs b/Command/RemoteDaemon.hs index 72502d9a6a..728b16da6d 100644 --- a/Command/RemoteDaemon.hs +++ b/Command/RemoteDaemon.hs @@ -12,7 +12,9 @@ module Command.RemoteDaemon where import Command import RemoteDaemon.Core import Utility.Daemon +#ifndef mingw32_HOST_OS import Annex.Path +#endif cmd :: Command cmd = noCommit $ diff --git a/Git/Hook.hs b/Git/Hook.hs index 39d653e020..ba9031d800 100644 --- a/Git/Hook.hs +++ b/Git/Hook.hs @@ -14,9 +14,11 @@ import Git import Utility.Tmp import Utility.Shell import Utility.FileMode +#ifndef mingw32_HOST_OS import qualified Utility.RawFilePath as R - import System.PosixCompat.Files (fileMode) +#endif + data Hook = Hook { hookName :: FilePath diff --git a/Remote/Directory.hs b/Remote/Directory.hs index 5721bd20fa..4d91b2551e 100644 --- a/Remote/Directory.hs +++ b/Remote/Directory.hs @@ -19,7 +19,10 @@ import qualified Data.ByteString.Lazy as L import qualified Data.Map as M import qualified System.FilePath.ByteString as P import Data.Default -import System.PosixCompat.Files (isRegularFile, getFdStatus, deviceID) +import System.PosixCompat.Files (isRegularFile, deviceID) +#ifndef mingw32_HOST_OS +import System.PosixCompat.Files (getFdStatus) +#endif import Annex.Common import Types.Remote diff --git a/Utility/DirWatcher/Win32Notify.hs b/Utility/DirWatcher/Win32Notify.hs index eaff7f95ff..f91f68247d 100644 --- a/Utility/DirWatcher/Win32Notify.hs +++ b/Utility/DirWatcher/Win32Notify.hs @@ -7,7 +7,7 @@ module Utility.DirWatcher.Win32Notify (watchDir) where -import Common hiding (isDirectory) +import Common import Utility.DirWatcher.Types import qualified Utility.RawFilePath as R diff --git a/Utility/FileMode.hs b/Utility/FileMode.hs index fd3d9a104a..5b56ff7c30 100644 --- a/Utility/FileMode.hs +++ b/Utility/FileMode.hs @@ -17,6 +17,9 @@ import System.IO import Control.Monad import System.PosixCompat.Types import System.PosixCompat.Files (unionFileModes, intersectFileModes, stdFileMode, nullFileMode, setFileCreationMask, groupReadMode, ownerReadMode, ownerWriteMode, ownerExecuteMode, groupWriteMode, groupExecuteMode, otherReadMode, otherWriteMode, otherExecuteMode, fileMode) +#ifndef mingw32_HOST_OS +import System.PosixCompat.Files (setFileCreationMask) +#endif import Control.Monad.IO.Class import Foreign (complement) import Control.Monad.Catch diff --git a/Utility/FileSize.hs b/Utility/FileSize.hs index 2268c3bdd8..3d216f2be4 100644 --- a/Utility/FileSize.hs +++ b/Utility/FileSize.hs @@ -14,13 +14,15 @@ module Utility.FileSize ( getFileSize', ) where -import System.PosixCompat.Files (FileStatus, fileSize) -import qualified Utility.RawFilePath as R #ifdef mingw32_HOST_OS import Control.Exception (bracket) import System.IO import Utility.FileSystemEncoding +#else +import System.PosixCompat.Files (fileSize) #endif +import System.PosixCompat.Files (FileStatus) +import qualified Utility.RawFilePath as R type FileSize = Integer diff --git a/Utility/InodeCache.hs b/Utility/InodeCache.hs index 6f07059f53..3828bc645a 100644 --- a/Utility/InodeCache.hs +++ b/Utility/InodeCache.hs @@ -54,9 +54,7 @@ import System.PosixCompat.Types import System.PosixCompat.Files (isRegularFile, fileID) import Data.Time.Clock.POSIX -#ifdef mingw32_HOST_OS -import Data.Word (Word64) -#else +#ifndef mingw32_HOST_OS import qualified System.Posix.Files as Posix #endif diff --git a/Utility/LockFile/Windows.hs b/Utility/LockFile/Windows.hs index 3b8e0dc02e..2ab521e438 100644 --- a/Utility/LockFile/Windows.hs +++ b/Utility/LockFile/Windows.hs @@ -21,7 +21,6 @@ import Control.Concurrent import Utility.Path.Windows import Utility.FileSystemEncoding -import Utility.Split type LockFile = RawFilePath diff --git a/Utility/MoveFile.hs b/Utility/MoveFile.hs index bba12fdb31..6481b29ed3 100644 --- a/Utility/MoveFile.hs +++ b/Utility/MoveFile.hs @@ -14,11 +14,11 @@ module Utility.MoveFile ( ) where import Control.Monad -import System.PosixCompat.Files (isDirectory) import System.IO.Error import Prelude #ifndef mingw32_HOST_OS +import System.PosixCompat.Files (isDirectory) import Control.Monad.IfElse import Utility.SafeCommand #endif