fsck: Ensure that files and directories in .git/annex/objects have proper permissions.
This commit is contained in:
parent
cf99575d74
commit
0956f0dd15
3 changed files with 19 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
module Command.Fsck where
|
module Command.Fsck where
|
||||||
|
|
||||||
|
import Control.Monad (when)
|
||||||
import Control.Monad.State (liftIO)
|
import Control.Monad.State (liftIO)
|
||||||
|
|
||||||
import Command
|
import Command
|
||||||
|
@ -18,6 +19,7 @@ import Messages
|
||||||
import Utility
|
import Utility
|
||||||
import Content
|
import Content
|
||||||
import LocationLog
|
import LocationLog
|
||||||
|
import Locations
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "fsck" (paramOptional $ paramRepeating paramPath) seek
|
command = [repoCommand "fsck" (paramOptional $ paramRepeating paramPath) seek
|
||||||
|
@ -47,9 +49,16 @@ perform key file backend numcopies = do
|
||||||
in this repository only. -}
|
in this repository only. -}
|
||||||
verifyLocationLog :: Key -> FilePath -> Annex Bool
|
verifyLocationLog :: Key -> FilePath -> Annex Bool
|
||||||
verifyLocationLog key file = do
|
verifyLocationLog key file = do
|
||||||
|
g <- Annex.gitRepo
|
||||||
present <- inAnnex key
|
present <- inAnnex key
|
||||||
|
|
||||||
g <- Annex.gitRepo
|
-- Since we're checking that a key's file is present, throw
|
||||||
|
-- in a permission fixup here too.
|
||||||
|
when present $ liftIO $ do
|
||||||
|
let f = gitAnnexLocation g key
|
||||||
|
preventWrite f
|
||||||
|
preventWrite (parentDir f)
|
||||||
|
|
||||||
u <- getUUID g
|
u <- getUUID g
|
||||||
uuids <- liftIO $ keyLocations g key
|
uuids <- liftIO $ keyLocations g key
|
||||||
|
|
||||||
|
|
7
debian/changelog
vendored
7
debian/changelog
vendored
|
@ -1,3 +1,10 @@
|
||||||
|
git-annex (0.20110329) UNRELEASED; urgency=low
|
||||||
|
|
||||||
|
* fsck: Ensure that files and directories in .git/annex/objects
|
||||||
|
have proper permissions.
|
||||||
|
|
||||||
|
-- Joey Hess <joeyh@debian.org> Mon, 28 Mar 2011 16:17:59 -0400
|
||||||
|
|
||||||
git-annex (0.20110328) experimental; urgency=low
|
git-annex (0.20110328) experimental; urgency=low
|
||||||
|
|
||||||
* annex.diskreserve can be given in arbitrary units (ie "0.5 gigabytes")
|
* annex.diskreserve can be given in arbitrary units (ie "0.5 gigabytes")
|
||||||
|
|
|
@ -4,3 +4,5 @@ The fsck command should check that they are still correct.
|
||||||
The fix command should fix them.
|
The fix command should fix them.
|
||||||
|
|
||||||
PS: Thanks for this nice tool!
|
PS: Thanks for this nice tool!
|
||||||
|
|
||||||
|
> Good idea, [[done]] (actually, fsck just fixes them too)! --[[Joey]]
|
||||||
|
|
Loading…
Reference in a new issue