diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-03-16 15:28:29 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-03-16 15:28:29 -0400 |
commit | e59ba02f81d756c48c14975da8185e98f2f9e546 (patch) | |
tree | 21411d867e6d57bca8b2d3efdb63e4517bfb14d0 /Remote | |
parent | 3f269443c184c74b263e708d4d011307aef6f19a (diff) |
remotedaemon: Fixed support for notifications of changes to gcrypt remotes, which was never tested and didn't quite work before.
Diffstat (limited to 'Remote')
-rw-r--r-- | Remote/GCrypt.hs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Remote/GCrypt.hs b/Remote/GCrypt.hs index 54c90536f..c27519825 100644 --- a/Remote/GCrypt.hs +++ b/Remote/GCrypt.hs @@ -10,7 +10,8 @@ module Remote.GCrypt ( chainGen, getGCryptUUID, coreGCryptId, - setupRepo + setupRepo, + accessShellConfig, ) where import qualified Data.Map as M @@ -265,17 +266,19 @@ setupRepo gcryptid r denyNonFastForwards = "receive.denyNonFastForwards" -isShell :: Remote -> Bool -isShell r = case method of +accessShell :: Remote -> Bool +accessShell = accessShellConfig . gitconfig + +accessShellConfig :: RemoteGitConfig -> Bool +accessShellConfig c = case method of AccessShell -> True _ -> False where - method = toAccessMethod $ fromMaybe "" $ - remoteAnnexGCrypt $ gitconfig r + method = toAccessMethod $ fromMaybe "" $ remoteAnnexGCrypt c shellOrRsync :: Remote -> Annex a -> Annex a -> Annex a shellOrRsync r ashell arsync - | isShell r = ashell + | accessShell r = ashell | otherwise = arsync {- Configure gcrypt to use the same list of keyids that @@ -319,7 +322,7 @@ store r rsyncopts let destdir = parentDir $ gCryptLocation r k Remote.Directory.finalizeStoreGeneric tmpdir destdir return True - | Git.repoIsSsh (repo r) = if isShell r + | Git.repoIsSsh (repo r) = if accessShell r then fileStorer $ \k f p -> Ssh.rsyncHelper (Just p) =<< Ssh.rsyncParamsRemote False r Upload k f Nothing else fileStorer $ Remote.Rsync.store rsyncopts @@ -330,7 +333,7 @@ retrieve r rsyncopts | not $ Git.repoIsUrl (repo r) = byteRetriever $ \k sink -> guardUsable (repo r) (return False) $ sink =<< liftIO (L.readFile $ gCryptLocation r k) - | Git.repoIsSsh (repo r) = if isShell r + | Git.repoIsSsh (repo r) = if accessShell r then fileRetriever $ \f k p -> unlessM (Ssh.rsyncHelper (Just p) =<< Ssh.rsyncParamsRemote False r Download k f Nothing) $ error "rsync failed" |