avoid warning when built with unix-compat 0.5.3
It re-exports modificationTimeHiRes, and provides a windows version. Might be worth using that windows version eventually, but I have not tested it.
This commit is contained in:
parent
0697dbe2d2
commit
887edeb1ad
3 changed files with 6 additions and 6 deletions
|
@ -19,7 +19,7 @@ import Utility.InodeCache
|
||||||
import qualified Utility.RawFilePath as R
|
import qualified Utility.RawFilePath as R
|
||||||
#if ! defined(mingw32_HOST_OS)
|
#if ! defined(mingw32_HOST_OS)
|
||||||
import Utility.Touch
|
import Utility.Touch
|
||||||
import System.Posix.Files (modificationTimeHiRes)
|
import qualified System.Posix.Files as Posix
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{- Populates a pointer file with the content of a key.
|
{- Populates a pointer file with the content of a key.
|
||||||
|
@ -66,7 +66,7 @@ depopulatePointerFile key file = do
|
||||||
-- by git in some cases.
|
-- by git in some cases.
|
||||||
liftIO $ maybe noop
|
liftIO $ maybe noop
|
||||||
(\t -> touch tmp' t False)
|
(\t -> touch tmp' t False)
|
||||||
(fmap modificationTimeHiRes st)
|
(fmap Posix.modificationTimeHiRes st)
|
||||||
#endif
|
#endif
|
||||||
withTSDelta (liftIO . genInodeCache (toRawFilePath tmp))
|
withTSDelta (liftIO . genInodeCache (toRawFilePath tmp))
|
||||||
maybe noop (restagePointerFile (Restage True) file) ic
|
maybe noop (restagePointerFile (Restage True) file) ic
|
||||||
|
|
|
@ -21,7 +21,7 @@ import qualified Utility.RawFilePath as R
|
||||||
|
|
||||||
#if ! defined(mingw32_HOST_OS)
|
#if ! defined(mingw32_HOST_OS)
|
||||||
import Utility.Touch
|
import Utility.Touch
|
||||||
import System.Posix.Files
|
import qualified System.Posix.Files as Posix
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
|
@ -94,7 +94,7 @@ fixSymlink :: RawFilePath -> RawFilePath -> CommandPerform
|
||||||
fixSymlink file link = do
|
fixSymlink file link = do
|
||||||
#if ! defined(mingw32_HOST_OS)
|
#if ! defined(mingw32_HOST_OS)
|
||||||
-- preserve mtime of symlink
|
-- preserve mtime of symlink
|
||||||
mtime <- liftIO $ catchMaybeIO $ modificationTimeHiRes
|
mtime <- liftIO $ catchMaybeIO $ Posix.modificationTimeHiRes
|
||||||
<$> R.getSymbolicLinkStatus file
|
<$> R.getSymbolicLinkStatus file
|
||||||
#endif
|
#endif
|
||||||
createWorkTreeDirectory (parentDir file)
|
createWorkTreeDirectory (parentDir file)
|
||||||
|
|
|
@ -55,7 +55,7 @@ import Data.Time.Clock.POSIX
|
||||||
#ifdef mingw32_HOST_OS
|
#ifdef mingw32_HOST_OS
|
||||||
import Data.Word (Word64)
|
import Data.Word (Word64)
|
||||||
#else
|
#else
|
||||||
import System.Posix.Files
|
import qualified System.Posix.Files as Posix
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
data InodeCachePrim = InodeCachePrim FileID FileSize MTime
|
data InodeCachePrim = InodeCachePrim FileID FileSize MTime
|
||||||
|
@ -200,7 +200,7 @@ toInodeCache' (TSDelta getdelta) f s inode
|
||||||
#ifdef mingw32_HOST_OS
|
#ifdef mingw32_HOST_OS
|
||||||
mtime <- utcTimeToPOSIXSeconds <$> getModificationTime (fromRawFilePath f)
|
mtime <- utcTimeToPOSIXSeconds <$> getModificationTime (fromRawFilePath f)
|
||||||
#else
|
#else
|
||||||
let mtime = modificationTimeHiRes s
|
let mtime = Posix.modificationTimeHiRes s
|
||||||
#endif
|
#endif
|
||||||
return $ Just $ InodeCache $ InodeCachePrim inode sz (MTimeHighRes (mtime + highResTime delta))
|
return $ Just $ InodeCache $ InodeCachePrim inode sz (MTimeHighRes (mtime + highResTime delta))
|
||||||
| otherwise = pure Nothing
|
| otherwise = pure Nothing
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue