fix build on windows
Annex.GitOverlay was using a module that needs posix to build.
This commit is contained in:
parent
98a8a6da81
commit
d3d187c869
3 changed files with 15 additions and 9 deletions
|
@ -24,7 +24,7 @@ import qualified Utility.LockFile.PidLock as PidF
|
||||||
import qualified Utility.LockPool.PidLock as PidP
|
import qualified Utility.LockPool.PidLock as PidP
|
||||||
import Utility.LockPool (dropLock)
|
import Utility.LockPool (dropLock)
|
||||||
import Utility.Env
|
import Utility.Env
|
||||||
import Annex.LockPool.PosixOrPid (pidLockFile)
|
import Config
|
||||||
|
|
||||||
{- Runs an action using a different git index file. -}
|
{- Runs an action using a different git index file. -}
|
||||||
withIndexFile :: AltIndexFile -> (FilePath -> Annex a) -> Annex a
|
withIndexFile :: AltIndexFile -> (FilePath -> Annex a) -> Annex a
|
||||||
|
|
|
@ -18,12 +18,10 @@ module Annex.LockPool.PosixOrPid (
|
||||||
LockStatus(..),
|
LockStatus(..),
|
||||||
getLockStatus,
|
getLockStatus,
|
||||||
checkSaneLock,
|
checkSaneLock,
|
||||||
pidLockFile,
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Common
|
import Common
|
||||||
import Types
|
import Types
|
||||||
import Annex.Locations
|
|
||||||
import qualified Annex
|
import qualified Annex
|
||||||
import qualified Utility.LockPool.Posix as Posix
|
import qualified Utility.LockPool.Posix as Posix
|
||||||
import qualified Utility.LockPool.PidLock as Pid
|
import qualified Utility.LockPool.PidLock as Pid
|
||||||
|
@ -32,6 +30,7 @@ import Utility.LockPool.LockHandle (LockHandle, dropLock)
|
||||||
import Utility.LockFile.Posix (openLockFile)
|
import Utility.LockFile.Posix (openLockFile)
|
||||||
import Utility.LockPool.STM (LockFile)
|
import Utility.LockPool.STM (LockFile)
|
||||||
import Utility.LockFile.LockStatus
|
import Utility.LockFile.LockStatus
|
||||||
|
import Config (pidLockFile)
|
||||||
|
|
||||||
import System.Posix
|
import System.Posix
|
||||||
|
|
||||||
|
@ -63,12 +62,6 @@ checkSaneLock :: LockFile -> LockHandle -> Annex Bool
|
||||||
checkSaneLock f h = H.checkSaneLock f h
|
checkSaneLock f h = H.checkSaneLock f h
|
||||||
`pidLockCheck` flip Pid.checkSaneLock h
|
`pidLockCheck` flip Pid.checkSaneLock h
|
||||||
|
|
||||||
pidLockFile :: Annex (Maybe FilePath)
|
|
||||||
pidLockFile = ifM (annexPidLock <$> Annex.getGitConfig)
|
|
||||||
( Just <$> Annex.fromRepo gitAnnexPidLockFile
|
|
||||||
, pure Nothing
|
|
||||||
)
|
|
||||||
|
|
||||||
pidLockCheck :: IO a -> (LockFile -> IO a) -> Annex a
|
pidLockCheck :: IO a -> (LockFile -> IO a) -> Annex a
|
||||||
pidLockCheck posixcheck pidcheck = debugLocks $
|
pidLockCheck posixcheck pidcheck = debugLocks $
|
||||||
liftIO . maybe posixcheck pidcheck =<< pidLockFile
|
liftIO . maybe posixcheck pidcheck =<< pidLockFile
|
||||||
|
|
13
Config.hs
13
Config.hs
|
@ -6,12 +6,14 @@
|
||||||
-}
|
-}
|
||||||
|
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE CPP #-}
|
||||||
|
|
||||||
module Config (
|
module Config (
|
||||||
module Config,
|
module Config,
|
||||||
annexConfig,
|
annexConfig,
|
||||||
remoteAnnexConfig,
|
remoteAnnexConfig,
|
||||||
remoteConfig,
|
remoteConfig,
|
||||||
|
pidLockFile,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Annex.Common
|
import Annex.Common
|
||||||
|
@ -23,6 +25,7 @@ import Config.Cost
|
||||||
import Config.DynamicConfig
|
import Config.DynamicConfig
|
||||||
import Types.Availability
|
import Types.Availability
|
||||||
import Types.GitConfig
|
import Types.GitConfig
|
||||||
|
import Annex.Locations
|
||||||
import Git.Types
|
import Git.Types
|
||||||
|
|
||||||
{- Looks up a setting in git config. This is not as efficient as using the
|
{- Looks up a setting in git config. This is not as efficient as using the
|
||||||
|
@ -83,3 +86,13 @@ crippledFileSystem = annexCrippledFileSystem <$> Annex.getGitConfig
|
||||||
setCrippledFileSystem :: Bool -> Annex ()
|
setCrippledFileSystem :: Bool -> Annex ()
|
||||||
setCrippledFileSystem b =
|
setCrippledFileSystem b =
|
||||||
setConfig (annexConfig "crippledfilesystem") (Git.Config.boolConfig b)
|
setConfig (annexConfig "crippledfilesystem") (Git.Config.boolConfig b)
|
||||||
|
|
||||||
|
pidLockFile :: Annex (Maybe FilePath)
|
||||||
|
#ifndef mingw32_HOST_OS
|
||||||
|
pidLockFile = ifM (annexPidLock <$> Annex.getGitConfig)
|
||||||
|
( Just <$> Annex.fromRepo gitAnnexPidLockFile
|
||||||
|
, pure Nothing
|
||||||
|
)
|
||||||
|
#else
|
||||||
|
pidLockFile = pure Nothing
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue