init: Fix a reversion that broke initialization on systems that need to use pid locking

This brings back .git/annex/misctmp, but only for init. If an init
is interrupted while probing using that temp directory, the files it left
will get deleted 1 week later by a subsequent git-annex run.
This commit is contained in:
Joey Hess 2019-09-10 13:37:07 -04:00
parent 07de0e7e9d
commit 94c75d2bd9
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
7 changed files with 42 additions and 13 deletions

View file

@ -166,7 +166,7 @@ isInitialized = maybe Annex.Branch.hasSibling (const $ return True) =<< getVersi
{- A crippled filesystem is one that does not allow making symlinks,
- or removing write access from files. -}
probeCrippledFileSystem :: Annex Bool
probeCrippledFileSystem = withOtherTmp $ \tmp -> do
probeCrippledFileSystem = withEventuallyCleanedOtherTmp $ \tmp -> do
(r, warnings) <- liftIO $ probeCrippledFileSystem' tmp
mapM_ warning warnings
return r
@ -229,7 +229,7 @@ probeLockSupport = do
#ifdef mingw32_HOST_OS
return True
#else
withOtherTmp $ \tmp -> do
withEventuallyCleanedOtherTmp $ \tmp -> do
let f = tmp </> "lockprobe"
mode <- annexFileMode
liftIO $ do
@ -247,7 +247,7 @@ probeFifoSupport = do
#ifdef mingw32_HOST_OS
return False
#else
withOtherTmp $ \tmp -> do
withEventuallyCleanedOtherTmp $ \tmp -> do
let f = tmp </> "gaprobe"
let f2 = tmp </> "gaprobe2"
liftIO $ do