unused: Write .git/annex/unused etc files with appropriate permissions for the core.sharedRepository config.

This commit was sponsored by an anonymous bitcoin donor.
This commit is contained in:
Joey Hess 2018-01-02 16:25:27 -04:00
parent 75366d3c34
commit edd25f04d9
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 18 additions and 1 deletions

View file

@ -11,6 +11,8 @@ git-annex (6.20171215) UNRELEASED; urgency=medium
* addurl: Fix encoding of filename queried from youtube-dl when in
--fast mode.
* git-annex.cabal: Add back custom-setup stanza, so cabal new-build works.
* unused: Write .git/annex/unused etc files with appropriate permissions
for the core.sharedRepository config.
-- Joey Hess <id@joeyh.name> Wed, 20 Dec 2017 12:11:46 -0400

View file

@ -33,6 +33,7 @@ import Data.Time
import Annex.Common
import qualified Annex
import Annex.Perms
import Utility.Tmp
import Logs.TimeStamp
@ -64,10 +65,13 @@ updateUnusedLog prefix m = do
writeUnusedLog :: FilePath -> UnusedLog -> Annex ()
writeUnusedLog prefix l = do
logfile <- fromRepo $ gitAnnexUnusedLog prefix
liftIO $ viaTmp writeFile logfile $ unlines $ map format $ M.toList l
viaTmp writelog logfile $ unlines $ map format $ M.toList l
where
format (k, (i, Just t)) = show i ++ " " ++ key2file k ++ " " ++ show t
format (k, (i, Nothing)) = show i ++ " " ++ key2file k
writelog f c = do
liftIO $ writeFile f c
setAnnexFilePerm f
readUnusedLog :: FilePath -> Annex UnusedLog
readUnusedLog prefix = do

View file

@ -69,3 +69,5 @@ This is somewhat expected, because the permissions of `unused`, `badunused` and
-rw------- 1 ele testgroup 101 dic 19 14:50 unused
If this is the intended behavior, could you please explain me how to use `git annex unused` and `dropunused` in a shared repository?
> Fixed all of this I was able to reproduce. [[done]] --[[Joey]]

View file

@ -0,0 +1,9 @@
[[!comment format=mdwn
username="joey"
subject="""comment 2"""
date="2018-01-02T20:17:03Z"
content="""
Fixed, but I was not able to reproduce the part where dropunused failed
with a permissions error involving .git/annex/misctmp, despite having it
set up the same as you did.
"""]]