sync: support gcrypt

This commit is contained in:
Joey Hess 2013-09-09 09:58:17 -04:00
parent 51ee077d58
commit b64f5baf2d
7 changed files with 23 additions and 14 deletions

View file

@ -57,8 +57,7 @@ calcSyncRemotes = do
return $ \dstatus -> dstatus return $ \dstatus -> dstatus
{ syncRemotes = syncable { syncRemotes = syncable
, syncGitRemotes = , syncGitRemotes = filter Remote.syncableRemote syncable
filter (not . Remote.specialRemote) syncable
, syncDataRemotes = syncdata , syncDataRemotes = syncdata
, syncingToCloudRemote = any iscloud syncdata , syncingToCloudRemote = any iscloud syncdata
} }

View file

@ -67,12 +67,12 @@ syncRemotes rs = ifM (Annex.getState Annex.fast) ( nub <$> pickfast , wanted )
| otherwise = listed | otherwise = listed
listed = do listed = do
l <- catMaybes <$> mapM (Remote.byName . Just) rs l <- catMaybes <$> mapM (Remote.byName . Just) rs
let s = filter Remote.specialRemote l let s = filter (not . Remote.syncableRemote) l
unless (null s) $ unless (null s) $
error $ "cannot sync special remotes: " ++ error $ "cannot sync special remotes: " ++
unwords (map Types.Remote.name s) unwords (map Types.Remote.name s)
return l return l
available = filter (not . Remote.specialRemote) available = filter Remote.syncableRemote
. filter (remoteAnnexSync . Types.Remote.gitconfig) . filter (remoteAnnexSync . Types.Remote.gitconfig)
<$> Remote.remoteList <$> Remote.remoteList
good = filterM $ Remote.Git.repoAvail . Types.Remote.repo good = filterM $ Remote.Git.repoAvail . Types.Remote.repo

View file

@ -19,7 +19,7 @@ module Remote (
remoteTypes, remoteTypes,
remoteList, remoteList,
specialRemote, syncableRemote,
remoteMap, remoteMap,
uuidDescriptions, uuidDescriptions,
byName, byName,

View file

@ -125,6 +125,14 @@ gen r u c gc
repoAvail :: Git.Repo -> Annex Bool repoAvail :: Git.Repo -> Annex Bool
repoAvail r repoAvail r
| Git.repoIsHttp r = return True | Git.repoIsHttp r = return True
| Git.GCrypt.isEncrypted r = do
g <- gitRepo
liftIO $ do
er <- Git.GCrypt.encryptedRepo g r
if Git.repoIsLocal er || Git.repoIsLocalUnknown er
then catchBoolIO $
void (Git.Config.read er) >> return True
else return True
| Git.repoIsUrl r = return True | Git.repoIsUrl r = return True
| Git.repoIsLocalUnknown r = return False | Git.repoIsLocalUnknown r = return False
| otherwise = liftIO $ catchBoolIO $ onLocal r $ return True | otherwise = liftIO $ catchBoolIO $ onLocal r $ return True

View file

@ -100,6 +100,7 @@ updateRemote remote = do
Remote.Git.configRead r Remote.Git.configRead r
| otherwise = return r | otherwise = return r
{- Checks if a remote is a special remote -} {- Checks if a remote is syncable using git. -}
specialRemote :: Remote -> Bool syncableRemote :: Remote -> Bool
specialRemote r = remotetype r /= Remote.Git.remote syncableRemote r = remotetype r `elem`
[ Remote.Git.remote, Remote.GCrypt.remote ]

11
debian/changelog vendored
View file

@ -1,4 +1,4 @@
git-annex (4.20130828) UNRELEASED; urgency=low git-annex (4.20130909) unstable; urgency=low
* initremote: Syntax change when setting up an encrypted special remote. * initremote: Syntax change when setting up an encrypted special remote.
Now use keyid=$KEYID rather than the old encryption=$KEYID Now use keyid=$KEYID rather than the old encryption=$KEYID
@ -9,6 +9,10 @@ git-annex (4.20130828) UNRELEASED; urgency=low
have been marked as dead from the git-annex branch. have been marked as dead from the git-annex branch.
* sync, assistant: Force push of the git-annex branch. Necessary * sync, assistant: Force push of the git-annex branch. Necessary
to ensure it gets pushed to remotes after being rewritten by forget. to ensure it gets pushed to remotes after being rewritten by forget.
* Added gcrypt support. This combines a fully encrypted git
repository (using git-remote-gcrypt) with an encrypted git-annex special
remote.
* sync: Support syncing with gcrypt remotes.
* importfeed: Also ignore transient problems with downloading content * importfeed: Also ignore transient problems with downloading content
from feeds. from feeds.
* Honor core.sharedrepository when receiving and adding files in direct * Honor core.sharedrepository when receiving and adding files in direct
@ -24,9 +28,6 @@ git-annex (4.20130828) UNRELEASED; urgency=low
* Remind user when annex-ignore is set for some remotes, if unable to * Remind user when annex-ignore is set for some remotes, if unable to
get or drop a file, possibly because it's on an ignored remote. get or drop a file, possibly because it's on an ignored remote.
* gpg: Force --no-textmode in case the user has it turned on in config. * gpg: Force --no-textmode in case the user has it turned on in config.
* Added gcrypt support. This combines a fully encrypted git
repository (using git-remote-gcrypt) with an encrypted git-annex special
remote.
* webapp: Improve javascript's handling of longpolling connection * webapp: Improve javascript's handling of longpolling connection
failures, by reloading the current page in this case. failures, by reloading the current page in this case.
Works around chromium behavior where ajax connections to urls Works around chromium behavior where ajax connections to urls
@ -34,7 +35,7 @@ git-annex (4.20130828) UNRELEASED; urgency=low
a previous page. a previous page.
* Allow building without quvi support. * Allow building without quvi support.
-- Joey Hess <joeyh@debian.org> Tue, 27 Aug 2013 11:03:00 -0400 -- Joey Hess <joeyh@debian.org> Mon, 09 Sep 2013 09:47:02 -0400
git-annex (4.20130827) unstable; urgency=low git-annex (4.20130827) unstable; urgency=low

View file

@ -1,5 +1,5 @@
Name: git-annex Name: git-annex
Version: 4.20130827 Version: 4.20130909
Cabal-Version: >= 1.8 Cabal-Version: >= 1.8
License: GPL-3 License: GPL-3
Maintainer: Joey Hess <joey@kitenet.net> Maintainer: Joey Hess <joey@kitenet.net>