honor core.sharedRepository when making all the other files in the annex

Lock files, directories, etc.
This commit is contained in:
Joey Hess 2012-04-21 16:59:49 -04:00
parent 7e45712d19
commit b98b69e8c6
8 changed files with 119 additions and 33 deletions

View file

@ -12,6 +12,7 @@ import System.Posix.Types (Fd)
import Common.Annex
import Annex
import Annex.Perms
{- Create a specified lock file, and takes a shared lock. -}
lockFile :: FilePath -> Annex ()
@ -19,7 +20,9 @@ lockFile file = go =<< fromPool file
where
go (Just _) = return () -- already locked
go Nothing = do
fd <- liftIO $ openFd file ReadOnly (Just stdFileMode) defaultFileFlags
mode <- annexFileMode
fd <- liftIO $ noUmask mode $
openFd file ReadOnly (Just mode) defaultFileFlags
liftIO $ waitToSetLock fd (ReadLock, AbsoluteSeek, 0, 0)
changePool $ M.insert file fd