windows: fix fsck --incremental to not crash
Although it is still not incremental.
This commit is contained in:
parent
1c6dc0521f
commit
8952ccec1b
2 changed files with 14 additions and 4 deletions
|
@ -463,7 +463,9 @@ getFsckTime key = do
|
||||||
-
|
-
|
||||||
- To guard against time stamp damange (for example, if an annex directory
|
- To guard against time stamp damange (for example, if an annex directory
|
||||||
- is copied without -a), the fsckstate file contains a time that should
|
- 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 :: Annex ()
|
||||||
recordStartTime = do
|
recordStartTime = do
|
||||||
f <- fromRepo gitAnnexFsckState
|
f <- fromRepo gitAnnexFsckState
|
||||||
|
@ -471,8 +473,12 @@ recordStartTime = do
|
||||||
liftIO $ do
|
liftIO $ do
|
||||||
nukeFile f
|
nukeFile f
|
||||||
withFile f WriteMode $ \h -> do
|
withFile f WriteMode $ \h -> do
|
||||||
|
#ifndef mingw32_HOST_OS
|
||||||
t <- modificationTime <$> getFileStatus f
|
t <- modificationTime <$> getFileStatus f
|
||||||
hPutStr h $ showTime $ realToFrac t
|
hPutStr h $ showTime $ realToFrac t
|
||||||
|
#else
|
||||||
|
noop
|
||||||
|
#endif
|
||||||
where
|
where
|
||||||
showTime :: POSIXTime -> String
|
showTime :: POSIXTime -> String
|
||||||
showTime = show
|
showTime = show
|
||||||
|
@ -486,10 +492,14 @@ getStartTime = do
|
||||||
f <- fromRepo gitAnnexFsckState
|
f <- fromRepo gitAnnexFsckState
|
||||||
liftIO $ catchDefaultIO Nothing $ do
|
liftIO $ catchDefaultIO Nothing $ do
|
||||||
timestamp <- modificationTime <$> getFileStatus f
|
timestamp <- modificationTime <$> getFileStatus f
|
||||||
|
#ifndef mingw32_HOST_OS
|
||||||
t <- readishTime <$> readFile f
|
t <- readishTime <$> readFile f
|
||||||
return $ if Just (realToFrac timestamp) == t
|
return $ if Just (realToFrac timestamp) == t
|
||||||
then Just timestamp
|
then Just timestamp
|
||||||
else Nothing
|
else Nothing
|
||||||
|
#else
|
||||||
|
return $ Just timestamp
|
||||||
|
#endif
|
||||||
where
|
where
|
||||||
readishTime :: String -> Maybe POSIXTime
|
readishTime :: String -> Maybe POSIXTime
|
||||||
readishTime s = utcTimeToPOSIXSeconds <$>
|
readishTime s = utcTimeToPOSIXSeconds <$>
|
||||||
|
|
|
@ -38,9 +38,6 @@ now! --[[Joey]]
|
||||||
starting git-annex from the menu failed with `file://C:\Documents does
|
starting git-annex from the menu failed with `file://C:\Documents does
|
||||||
not exist`. The local repo was `C:\Documents and Settings\...\...`
|
not exist`. The local repo was `C:\Documents and Settings\...\...`
|
||||||
* View debug log is empty in windows -- all log must goes to console.
|
* 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.
|
* Local pairing seems to fail, after acking on Linux box, it stalls.
|
||||||
* rsync.net setup failed. Seems to have generated a hostname including
|
* rsync.net setup failed. Seems to have generated a hostname including
|
||||||
the directory somehow.
|
the directory somehow.
|
||||||
|
@ -51,6 +48,9 @@ now! --[[Joey]]
|
||||||
* glacier-cli is not easily available (probably)
|
* glacier-cli is not easily available (probably)
|
||||||
* When clicking on the Files at the top of the webapp, a file
|
* 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.
|
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
|
## stuff needing testing
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue