From 346007a9158fc10d12a96cdafc2d285a6ce1a2a4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 24 Feb 2022 14:01:29 -0400 Subject: [PATCH] add debugging of freeze and thaw --- Annex/Perms.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Annex/Perms.hs b/Annex/Perms.hs index d0fcaf8529..fff40507d7 100644 --- a/Annex/Perms.hs +++ b/Annex/Perms.hs @@ -5,6 +5,8 @@ - Licensed under the GNU AGPL version 3 or higher. -} +{-# LANGUAGE OverloadedStrings #-} + module Annex.Perms ( FileMode, setAnnexFilePerm, @@ -155,6 +157,7 @@ freezeContent' sr file = freezeContent'' sr file =<< getVersion freezeContent'' :: SharedRepository -> RawFilePath -> Maybe RepoVersion -> Annex () freezeContent'' sr file rv = do + fastDebug "Annex.Perms" ("freezing content " ++ fromRawFilePath file) go sr freezeHook file where @@ -231,7 +234,9 @@ thawContent :: RawFilePath -> Annex () thawContent file = withShared $ \sr -> thawContent' sr file 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 go GroupShared = 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 file = unlessM crippledFileSystem $ do + fastDebug "Annex.Perms" ("freezing content directory " ++ fromRawFilePath dir) withShared go freezeHook dir where @@ -263,7 +269,9 @@ freezeContentDir file = unlessM crippledFileSystem $ do go _ = liftIO $ preventWrite dir 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 dir = parentDir file -- 2.30.2