diff options
author | 2014-02-13 12:40:10 -0400 | |
---|---|---|
committer | 2014-02-13 12:40:10 -0400 | |
commit | 3b27ac0a3072b6c9c5907d867439fdb096d4253f (patch) | |
tree | 050f2b57476e7bd606b4dce9a40a0683e5dd2bae | |
parent | 7b2a2192cc6871a74177f35543a0590a022e51ca (diff) |
windows: fix fsck --incremental to not crash
Although it is still not incremental.
-rw-r--r-- | Command/Fsck.hs | 12 | ||||
-rw-r--r-- | doc/todo/windows_support.mdwn | 6 |
2 files changed, 14 insertions, 4 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs index cdbb155c2..d58ce2826 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -463,7 +463,9 @@ getFsckTime key = do - - To guard against time stamp damange (for example, if an annex directory - is copied without -a), the fsckstate file contains a time that should - - be identical to its modification time. -} + - be identical to its modification time. + - (This is not possible to do on Windows.) + -} recordStartTime :: Annex () recordStartTime = do f <- fromRepo gitAnnexFsckState @@ -471,8 +473,12 @@ recordStartTime = do liftIO $ do nukeFile f withFile f WriteMode $ \h -> do +#ifndef mingw32_HOST_OS t <- modificationTime <$> getFileStatus f hPutStr h $ showTime $ realToFrac t +#else + noop +#endif where showTime :: POSIXTime -> String showTime = show @@ -486,10 +492,14 @@ getStartTime = do f <- fromRepo gitAnnexFsckState liftIO $ catchDefaultIO Nothing $ do timestamp <- modificationTime <$> getFileStatus f +#ifndef mingw32_HOST_OS t <- readishTime <$> readFile f return $ if Just (realToFrac timestamp) == t then Just timestamp else Nothing +#else + return $ Just timestamp +#endif where readishTime :: String -> Maybe POSIXTime readishTime s = utcTimeToPOSIXSeconds <$> diff --git a/doc/todo/windows_support.mdwn b/doc/todo/windows_support.mdwn index aefec9f50..357697fee 100644 --- a/doc/todo/windows_support.mdwn +++ b/doc/todo/windows_support.mdwn @@ -38,9 +38,6 @@ now! --[[Joey]] starting git-annex from the menu failed with `file://C:\Documents does not exist`. The local repo was `C:\Documents and Settings\...\...` * View debug log is empty in windows -- all log must goes to console. -* Adding removable drive repo failed setting core.fsyncobjectfiles - Error: `could not lock config file /annex/.git/config: No such file or - directory` -- seems to be a drive path problem? * Local pairing seems to fail, after acking on Linux box, it stalls. * rsync.net setup failed. Seems to have generated a hostname including the directory somehow. @@ -51,6 +48,9 @@ now! --[[Joey]] * glacier-cli is not easily available (probably) * When clicking on the Files at the top of the webapp, a file browser *is* opened, but it has a Z-order underneath the web browser. +* Incremental fsck sets the sticky bit to record when a file is fscked, + and this is not done on windows, so fsck doesn't behave incrementally + there. ## stuff needing testing |