ported almost all remotes, until my brain melted
external is not started yet, and S3 is part way through and not compiling yet
This commit is contained in:
parent
c498269a88
commit
c4ea3ca40a
13 changed files with 265 additions and 150 deletions
|
@ -1,6 +1,6 @@
|
|||
{- Using bup as a remote.
|
||||
-
|
||||
- Copyright 2011-2019 Joey Hess <id@joeyh.name>
|
||||
- Copyright 2011-2020 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
@ -25,6 +25,7 @@ import qualified Git.Ref
|
|||
import Config
|
||||
import Config.Cost
|
||||
import qualified Remote.Helper.Ssh as Ssh
|
||||
import Annex.SpecialRemote.Config
|
||||
import Remote.Helper.Special
|
||||
import Remote.Helper.Messages
|
||||
import Remote.Helper.ExportImport
|
||||
|
@ -38,16 +39,21 @@ import Types.ProposedAccepted
|
|||
type BupRepo = String
|
||||
|
||||
remote :: RemoteType
|
||||
remote = RemoteType
|
||||
remote = specialRemoteType $ RemoteType
|
||||
{ typename = "bup"
|
||||
, enumerate = const (findSpecialRemotes "buprepo")
|
||||
, generate = gen
|
||||
, configParser = mkRemoteConfigParser
|
||||
[optionalStringParser buprepoField]
|
||||
, setup = bupSetup
|
||||
, exportSupported = exportUnsupported
|
||||
, importSupported = importUnsupported
|
||||
}
|
||||
|
||||
gen :: Git.Repo -> UUID -> RemoteConfig -> RemoteGitConfig -> RemoteStateHandle -> Annex (Maybe Remote)
|
||||
buprepoField :: RemoteConfigField
|
||||
buprepoField = Accepted "buprepo"
|
||||
|
||||
gen :: Git.Repo -> UUID -> ParsedRemoteConfig -> RemoteGitConfig -> RemoteStateHandle -> Annex (Maybe Remote)
|
||||
gen r u c gc rs = do
|
||||
bupr <- liftIO $ bup2GitRemote buprepo
|
||||
cst <- remoteCost gc $
|
||||
|
@ -110,7 +116,7 @@ bupSetup _ mu _ c gc = do
|
|||
|
||||
-- verify configuration is sane
|
||||
let buprepo = maybe (giveup "Specify buprepo=") fromProposedAccepted $
|
||||
M.lookup (Accepted "buprepo") c
|
||||
M.lookup buprepoField c
|
||||
(c', _encsetup) <- encryptionSetup c gc
|
||||
|
||||
-- bup init will create the repository.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue