added GETWANTED, SETWANTED for Tobias's flickr remote
This was unexpectedly difficult because of a depdenency cycle. To parse a preferred content expression involves several things that need to operate on the list of remotes. Which needs Remote.External. The only way to avoid this cycle (I tried breaking it at several points) was to skip parsing the expression in SETWANTED. That's sorta ok, because git-annex already has to deal with unparsable preferred content expressions being stored, in order to handle eg, upgrades. But I'm still not very happy that I cannot check it. I feel this is a strong indication that I need to beware of further bloating the special remote protocol interface.
This commit is contained in:
parent
f0a6de1ca2
commit
8e3032df2d
6 changed files with 61 additions and 19 deletions
5
Remote/External/Types.hs
vendored
5
Remote/External/Types.hs
vendored
|
@ -33,6 +33,7 @@ module Remote.External.Types (
|
|||
import Common.Annex
|
||||
import Annex.Exception
|
||||
import Types.Key (file2key, key2file)
|
||||
import Types.StandardGroups (PreferredContentExpression)
|
||||
import Utility.Metered (BytesProcessed(..))
|
||||
import Logs.Transfer (Direction(..))
|
||||
import Config.Cost (Cost)
|
||||
|
@ -167,6 +168,8 @@ data RemoteRequest
|
|||
| SETCREDS Setting String String
|
||||
| GETCREDS Setting
|
||||
| GETUUID
|
||||
| SETWANTED PreferredContentExpression
|
||||
| GETWANTED
|
||||
deriving (Show)
|
||||
|
||||
instance Receivable RemoteRequest where
|
||||
|
@ -178,6 +181,8 @@ instance Receivable RemoteRequest where
|
|||
parseCommand "SETCREDS" = parse3 SETCREDS
|
||||
parseCommand "GETCREDS" = parse1 GETCREDS
|
||||
parseCommand "GETUUID" = parse0 GETUUID
|
||||
parseCommand "SETWANTED" = parse1 SETWANTED
|
||||
parseCommand "GETWANTED" = parse0 GETWANTED
|
||||
parseCommand _ = parseFail
|
||||
|
||||
-- Responses to RemoteRequest.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue