Revert "use unix-compat 0.5 on windows"
This reverts commit 3ec579f5e1
.
Too early for this; needs newer Win32 version. Le sigh.
This commit is contained in:
parent
89f8777b6a
commit
5f55082d10
10 changed files with 51 additions and 13 deletions
|
@ -50,7 +50,6 @@ module Annex.Content (
|
|||
) where
|
||||
|
||||
import System.IO.Unsafe (unsafeInterleaveIO)
|
||||
import System.PosixCompat.Files
|
||||
import qualified Data.Set as S
|
||||
|
||||
import Annex.Common
|
||||
|
@ -85,6 +84,7 @@ 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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -18,7 +18,6 @@ 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
|
||||
|
@ -29,6 +28,7 @@ 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
|
||||
|
|
|
@ -11,7 +11,7 @@ import Common hiding (isDirectory)
|
|||
import Utility.DirWatcher.Types
|
||||
|
||||
import System.Win32.Notify
|
||||
import qualified System.PosixCompat.Files as Files
|
||||
import qualified Utility.PosixFiles as Files
|
||||
|
||||
watchDir :: FilePath -> (FilePath -> Bool) -> Bool -> WatchHooks -> IO WatchManager
|
||||
watchDir dir ignored scanevents hooks = do
|
||||
|
|
|
@ -16,7 +16,6 @@ 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)
|
||||
|
@ -32,6 +31,7 @@ import Control.Monad.IfElse
|
|||
#endif
|
||||
|
||||
import Utility.SystemDirectory
|
||||
import Utility.PosixFiles
|
||||
import Utility.Tmp
|
||||
import Utility.Exception
|
||||
import Utility.Monad
|
||||
|
|
|
@ -15,7 +15,7 @@ module Utility.FileMode (
|
|||
import System.IO
|
||||
import Control.Monad
|
||||
import System.PosixCompat.Types
|
||||
import System.PosixCompat.Files
|
||||
import Utility.PosixFiles
|
||||
#ifndef mingw32_HOST_OS
|
||||
import System.Posix.Files
|
||||
import Control.Monad.IO.Class (liftIO)
|
||||
|
|
42
Utility/PosixFiles.hs
Normal file
42
Utility/PosixFiles.hs
Normal file
|
@ -0,0 +1,42 @@
|
|||
{- POSIX files (and compatablity wrappers).
|
||||
-
|
||||
- This is like System.PosixCompat.Files, but with a few fixes.
|
||||
-
|
||||
- Copyright 2014 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- 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
|
|
@ -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
|
||||
|
||||
|
|
|
@ -380,11 +380,7 @@ 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.5),
|
||||
setenv,
|
||||
Build-Depends: Win32 (== 2.3.1.1), Win32-extras, unix-compat (>= 0.4.1.3), setenv,
|
||||
process (>= 1.4.2.0)
|
||||
else
|
||||
Build-Depends: unix
|
||||
|
@ -1030,6 +1026,7 @@ Executable git-annex
|
|||
Utility.PartialPrelude
|
||||
Utility.Path
|
||||
Utility.Percentage
|
||||
Utility.PosixFiles
|
||||
Utility.Process
|
||||
Utility.Process.Shim
|
||||
Utility.QuickCheck
|
||||
|
|
|
@ -25,7 +25,6 @@ extra-deps:
|
|||
- bloomfilter-2.0.1.0
|
||||
- torrent-10000.1.1
|
||||
- yesod-default-1.2.0
|
||||
- unix-compat-0.5
|
||||
explicit-setup-deps:
|
||||
git-annex: true
|
||||
resolver: lts-9.10
|
||||
|
|
Loading…
Reference in a new issue