more windows build fixes
This commit is contained in:
parent
640dbaaaf8
commit
a09937580e
1 changed files with 14 additions and 2 deletions
|
@ -5,6 +5,8 @@
|
||||||
- Licensed under the GNU AGPL version 3 or higher.
|
- Licensed under the GNU AGPL version 3 or higher.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
{-# LANGUAGE CPP #-}
|
||||||
|
|
||||||
module Annex.GitOverlay (
|
module Annex.GitOverlay (
|
||||||
module Annex.GitOverlay,
|
module Annex.GitOverlay,
|
||||||
AltIndexFile(..),
|
AltIndexFile(..),
|
||||||
|
@ -20,11 +22,13 @@ import Git.Index
|
||||||
import Git.Env
|
import Git.Env
|
||||||
import qualified Annex
|
import qualified Annex
|
||||||
import qualified Annex.Queue
|
import qualified Annex.Queue
|
||||||
import qualified Utility.LockFile.PidLock as PidF
|
|
||||||
import qualified Utility.LockPool.PidLock as PidP
|
|
||||||
import Utility.LockPool (dropLock)
|
import Utility.LockPool (dropLock)
|
||||||
import Utility.Env
|
import Utility.Env
|
||||||
import Config
|
import Config
|
||||||
|
#ifndef mingw32_HOST_OS
|
||||||
|
import qualified Utility.LockFile.PidLock as PidF
|
||||||
|
import qualified Utility.LockPool.PidLock as PidP
|
||||||
|
#endif
|
||||||
|
|
||||||
{- 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
|
||||||
|
@ -145,6 +149,7 @@ withAltRepo modrepo unmodrepo a = do
|
||||||
- when git-annex is used without pid locking.
|
- when git-annex is used without pid locking.
|
||||||
-}
|
-}
|
||||||
runsGitAnnexChildProcess :: Annex a -> Annex a
|
runsGitAnnexChildProcess :: Annex a -> Annex a
|
||||||
|
#ifndef mingw32_HOST_OS
|
||||||
runsGitAnnexChildProcess a = pidLockFile >>= \case
|
runsGitAnnexChildProcess a = pidLockFile >>= \case
|
||||||
Nothing -> a
|
Nothing -> a
|
||||||
Just pidlock -> bracket (setup pidlock) cleanup (go pidlock)
|
Just pidlock -> bracket (setup pidlock) cleanup (go pidlock)
|
||||||
|
@ -168,8 +173,12 @@ runsGitAnnexChildProcess a = pidLockFile >>= \case
|
||||||
Nothing -> Nothing
|
Nothing -> Nothing
|
||||||
in g { Git.gitEnv = e' }
|
in g { Git.gitEnv = e' }
|
||||||
withAltRepo addenv rmenv (const a)
|
withAltRepo addenv rmenv (const a)
|
||||||
|
#else
|
||||||
|
runsGitAnnexChildProcess a = a
|
||||||
|
#endif
|
||||||
|
|
||||||
runsGitAnnexChildProcess' :: Git.Repo -> (Git.Repo -> IO a) -> Annex a
|
runsGitAnnexChildProcess' :: Git.Repo -> (Git.Repo -> IO a) -> Annex a
|
||||||
|
#ifndef mingw32_HOST_OS
|
||||||
runsGitAnnexChildProcess' r a = pidLockFile >>= \case
|
runsGitAnnexChildProcess' r a = pidLockFile >>= \case
|
||||||
Nothing -> liftIO $ a r
|
Nothing -> liftIO $ a r
|
||||||
Just pidlock -> liftIO $ bracket (setup pidlock) cleanup (go pidlock)
|
Just pidlock -> liftIO $ bracket (setup pidlock) cleanup (go pidlock)
|
||||||
|
@ -184,3 +193,6 @@ runsGitAnnexChildProcess' r a = pidLockFile >>= \case
|
||||||
v <- PidF.pidLockEnv pidlock
|
v <- PidF.pidLockEnv pidlock
|
||||||
r' <- addGitEnv r v "1"
|
r' <- addGitEnv r v "1"
|
||||||
a r'
|
a r'
|
||||||
|
#else
|
||||||
|
runsGitAnnexChildProcess' r a = liftIO $ a r
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue