get many more commands building again

about half are building now
This commit is contained in:
Joey Hess 2019-12-05 11:40:10 -04:00
parent 6535aea49a
commit 3c7fd09ec8
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
19 changed files with 100 additions and 92 deletions

View file

@ -37,13 +37,14 @@ seek ps = unlessM crippledFileSystem $ do
data FixWhat = FixSymlinks | FixAll
start :: FixWhat -> FilePath -> Key -> CommandStart
start :: FixWhat -> RawFilePath -> Key -> CommandStart
start fixwhat file key = do
currlink <- liftIO $ catchMaybeIO $ readSymbolicLink file
wantlink <- calcRepo $ gitAnnexLink file key
currlink <- liftIO $ catchMaybeIO $ readSymbolicLink $ fromRawFilePath file
wantlink <- calcRepo $ gitAnnexLink (fromRawFilePath file) key
case currlink of
Just l
| l /= wantlink -> fixby $ fixSymlink file wantlink
| l /= wantlink -> fixby $
fixSymlink (fromRawFilePath file) wantlink
| otherwise -> stop
Nothing -> case fixwhat of
FixAll -> fixthin
@ -52,15 +53,15 @@ start fixwhat file key = do
fixby = starting "fix" (mkActionItem (key, file))
fixthin = do
obj <- calcRepo $ gitAnnexLocation key
stopUnless (isUnmodified key file <&&> isUnmodified key obj) $ do
stopUnless (isUnmodified key (fromRawFilePath file) <&&> isUnmodified key obj) $ do
thin <- annexThin <$> Annex.getGitConfig
fs <- liftIO $ catchMaybeIO $ getFileStatus file
fs <- liftIO $ catchMaybeIO $ getFileStatus (fromRawFilePath file)
os <- liftIO $ catchMaybeIO $ getFileStatus obj
case (linkCount <$> fs, linkCount <$> os, thin) of
(Just 1, Just 1, True) ->
fixby $ makeHardLink file key
fixby $ makeHardLink (fromRawFilePath file) key
(Just n, Just n', False) | n > 1 && n == n' ->
fixby $ breakHardLink file key obj
fixby $ breakHardLink (fromRawFilePath file) key obj
_ -> stop
breakHardLink :: FilePath -> Key -> FilePath -> CommandPerform