add debugging of freeze and thaw
This commit is contained in:
parent
28bc5ce232
commit
346007a915
1 changed files with 10 additions and 2 deletions
|
@ -5,6 +5,8 @@
|
||||||
- Licensed under the GNU AGPL version 3 or higher.
|
- Licensed under the GNU AGPL version 3 or higher.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
|
||||||
module Annex.Perms (
|
module Annex.Perms (
|
||||||
FileMode,
|
FileMode,
|
||||||
setAnnexFilePerm,
|
setAnnexFilePerm,
|
||||||
|
@ -155,6 +157,7 @@ freezeContent' sr file = freezeContent'' sr file =<< getVersion
|
||||||
|
|
||||||
freezeContent'' :: SharedRepository -> RawFilePath -> Maybe RepoVersion -> Annex ()
|
freezeContent'' :: SharedRepository -> RawFilePath -> Maybe RepoVersion -> Annex ()
|
||||||
freezeContent'' sr file rv = do
|
freezeContent'' sr file rv = do
|
||||||
|
fastDebug "Annex.Perms" ("freezing content " ++ fromRawFilePath file)
|
||||||
go sr
|
go sr
|
||||||
freezeHook file
|
freezeHook file
|
||||||
where
|
where
|
||||||
|
@ -231,7 +234,9 @@ thawContent :: RawFilePath -> Annex ()
|
||||||
thawContent file = withShared $ \sr -> thawContent' sr file
|
thawContent file = withShared $ \sr -> thawContent' sr file
|
||||||
|
|
||||||
thawContent' :: SharedRepository -> RawFilePath -> Annex ()
|
thawContent' :: SharedRepository -> RawFilePath -> Annex ()
|
||||||
thawContent' sr file = thawPerms (go sr) (thawHook file)
|
thawContent' sr file = do
|
||||||
|
fastDebug "Annex.Perms" ("thawing content " ++ fromRawFilePath file)
|
||||||
|
thawPerms (go sr) (thawHook file)
|
||||||
where
|
where
|
||||||
go GroupShared = liftIO $ void $ tryIO $ groupWriteRead file
|
go GroupShared = liftIO $ void $ tryIO $ groupWriteRead file
|
||||||
go AllShared = liftIO $ void $ tryIO $ groupWriteRead file
|
go AllShared = liftIO $ void $ tryIO $ groupWriteRead file
|
||||||
|
@ -254,6 +259,7 @@ thawPerms a hook = ifM crippledFileSystem
|
||||||
-}
|
-}
|
||||||
freezeContentDir :: RawFilePath -> Annex ()
|
freezeContentDir :: RawFilePath -> Annex ()
|
||||||
freezeContentDir file = unlessM crippledFileSystem $ do
|
freezeContentDir file = unlessM crippledFileSystem $ do
|
||||||
|
fastDebug "Annex.Perms" ("freezing content directory " ++ fromRawFilePath dir)
|
||||||
withShared go
|
withShared go
|
||||||
freezeHook dir
|
freezeHook dir
|
||||||
where
|
where
|
||||||
|
@ -263,7 +269,9 @@ freezeContentDir file = unlessM crippledFileSystem $ do
|
||||||
go _ = liftIO $ preventWrite dir
|
go _ = liftIO $ preventWrite dir
|
||||||
|
|
||||||
thawContentDir :: RawFilePath -> Annex ()
|
thawContentDir :: RawFilePath -> Annex ()
|
||||||
thawContentDir file = thawPerms (liftIO $ allowWrite dir) (thawHook dir)
|
thawContentDir file = do
|
||||||
|
fastDebug "Annex.Perms" ("thawing content directory " ++ fromRawFilePath dir)
|
||||||
|
thawPerms (liftIO $ allowWrite dir) (thawHook dir)
|
||||||
where
|
where
|
||||||
dir = parentDir file
|
dir = parentDir file
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue