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:
parent
75366d3c34
commit
edd25f04d9
4 changed files with 18 additions and 1 deletions
|
@ -11,6 +11,8 @@ git-annex (6.20171215) UNRELEASED; urgency=medium
|
||||||
* addurl: Fix encoding of filename queried from youtube-dl when in
|
* addurl: Fix encoding of filename queried from youtube-dl when in
|
||||||
--fast mode.
|
--fast mode.
|
||||||
* git-annex.cabal: Add back custom-setup stanza, so cabal new-build works.
|
* 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
|
-- Joey Hess <id@joeyh.name> Wed, 20 Dec 2017 12:11:46 -0400
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ import Data.Time
|
||||||
|
|
||||||
import Annex.Common
|
import Annex.Common
|
||||||
import qualified Annex
|
import qualified Annex
|
||||||
|
import Annex.Perms
|
||||||
import Utility.Tmp
|
import Utility.Tmp
|
||||||
import Logs.TimeStamp
|
import Logs.TimeStamp
|
||||||
|
|
||||||
|
@ -64,10 +65,13 @@ updateUnusedLog prefix m = do
|
||||||
writeUnusedLog :: FilePath -> UnusedLog -> Annex ()
|
writeUnusedLog :: FilePath -> UnusedLog -> Annex ()
|
||||||
writeUnusedLog prefix l = do
|
writeUnusedLog prefix l = do
|
||||||
logfile <- fromRepo $ gitAnnexUnusedLog prefix
|
logfile <- fromRepo $ gitAnnexUnusedLog prefix
|
||||||
liftIO $ viaTmp writeFile logfile $ unlines $ map format $ M.toList l
|
viaTmp writelog logfile $ unlines $ map format $ M.toList l
|
||||||
where
|
where
|
||||||
format (k, (i, Just t)) = show i ++ " " ++ key2file k ++ " " ++ show t
|
format (k, (i, Just t)) = show i ++ " " ++ key2file k ++ " " ++ show t
|
||||||
format (k, (i, Nothing)) = show i ++ " " ++ key2file k
|
format (k, (i, Nothing)) = show i ++ " " ++ key2file k
|
||||||
|
writelog f c = do
|
||||||
|
liftIO $ writeFile f c
|
||||||
|
setAnnexFilePerm f
|
||||||
|
|
||||||
readUnusedLog :: FilePath -> Annex UnusedLog
|
readUnusedLog :: FilePath -> Annex UnusedLog
|
||||||
readUnusedLog prefix = do
|
readUnusedLog prefix = do
|
||||||
|
|
|
@ -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
|
-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?
|
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]]
|
||||||
|
|
|
@ -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.
|
||||||
|
"""]]
|
Loading…
Add table
Reference in a new issue