Unverified Commit 7a6559af authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Unbreak the build with directory < 1.2.3.0.

See https://github.com/haskell/cabal/pull/4950#issuecomment-352753882
for context.
parent fcabd874
{-# LANGUAGE CPP #-}
module Distribution.Client.Compat.Directory (setModificationTime) where
#if MIN_VERSION_directory(1,2,3)
import System.Directory (setModificationTime)
#else
import Data.Time.Clock (UTCTime)
setModificationTime :: FilePath -> UTCTime -> IO ()
setModificationTime _fp _t = return ()
#endif
......@@ -17,6 +17,8 @@ module Distribution.Client.Update
import Distribution.Simple.Setup
( fromFlag )
import Distribution.Client.Compat.Directory
( setModificationTime )
import Distribution.Client.Types
( Repo(..), RemoteRepo(..), maybeRepoRemote )
import Distribution.Client.HttpUtils
......@@ -40,7 +42,6 @@ import Distribution.Simple.Utils
import qualified Data.ByteString.Lazy as BS
import Distribution.Client.GZipUtils (maybeDecompress)
import System.Directory (setModificationTime)
import System.FilePath ((<.>), dropExtension)
import Data.Maybe (mapMaybe)
import Data.Time (getCurrentTime)
......
......@@ -168,6 +168,7 @@ library
Distribution.Client.CmdRepl
Distribution.Client.CmdRun
Distribution.Client.CmdTest
Distribution.Client.Compat.Directory
Distribution.Client.Compat.ExecutablePath
Distribution.Client.Compat.FileLock
Distribution.Client.Compat.FilePerms
......@@ -437,6 +438,7 @@ executable cabal
Distribution.Client.CmdRepl
Distribution.Client.CmdRun
Distribution.Client.CmdTest
Distribution.Client.Compat.Directory
Distribution.Client.Compat.ExecutablePath
Distribution.Client.Compat.FileLock
Distribution.Client.Compat.FilePerms
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment