add encryption support to directory special remotes

This commit is contained in:
Joey Hess 2011-04-16 16:29:28 -04:00
parent 669851454c
commit 5efd413270
2 changed files with 5 additions and 3 deletions

View file

@ -26,6 +26,7 @@ import Config
import Content
import Utility
import Remote.Special
import Remote.Encrypted
remote :: RemoteType Annex
remote = RemoteType {
@ -59,11 +60,12 @@ directorySetup u c = do
Just d -> d
e <- liftIO $ doesDirectoryExist dir
when (not e) $ error $ "Directory does not exist: " ++ dir
c' <- encryptionSetup c
-- The directory is stored in git config, not in this remote's
-- persistant state, so it can vary between hosts.
gitConfigSpecialRemote u c "directory" dir
return $ M.delete "directory" c
gitConfigSpecialRemote u c' "directory" dir
return $ M.delete "directory" c'
dirKey :: FilePath -> Key -> FilePath
dirKey d k = d </> hashDirMixed k </> f </> f

View file

@ -7,4 +7,4 @@ the drive's mountpoint as a directory remote.
Setup example:
# git annex initremote usbdrive directory=/media/usbdrive/
# git annex initremote usbdrive directory=/media/usbdrive/ encryption=none