From 830c30001b033d4381347739604015e36f7b5934 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Jan 2020 16:56:34 -0400 Subject: [PATCH] fix --describe-other-params of external when encryption is not specified Encryption not being specified makes lenientRemoteConfigParser fail to parse, and so it was not able to start the external up to get LISTCONFIGS. --- Remote/External.hs | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Remote/External.hs b/Remote/External.hs index 5d54f68f08..cf3676ccec 100644 --- a/Remote/External.hs +++ b/Remote/External.hs @@ -784,19 +784,22 @@ getInfoM external = (++) {- All unknown configs are passed through in case the external program - uses them. -} lenientRemoteConfigParser :: RemoteConfigParser -lenientRemoteConfigParser = addRemoteConfigParser specialRemoteConfigParsers $ - RemoteConfigParser - { remoteConfigFieldParsers = - [ optionalStringParser externaltypeField - (FieldDesc "type of external special remote to use") - , trueFalseParser readonlyField False - (FieldDesc "enable readonly mode") - ] - , remoteConfigRestPassthrough = Just - ( const True - , [("*", FieldDesc "all other parameters are passed to external special remote program")] - ) - } +lenientRemoteConfigParser = + addRemoteConfigParser specialRemoteConfigParsers baseRemoteConfigParser + +baseRemoteConfigParser :: RemoteConfigParser +baseRemoteConfigParser = RemoteConfigParser + { remoteConfigFieldParsers = + [ optionalStringParser externaltypeField + (FieldDesc "type of external special remote to use") + , trueFalseParser readonlyField False + (FieldDesc "enable readonly mode") + ] + , remoteConfigRestPassthrough = Just + ( const True + , [("*", FieldDesc "all other parameters are passed to external special remote program")] + ) + } {- When the remote supports LISTCONFIGS, only accept the ones it listed. - When it does not, accept all configs. -} @@ -826,7 +829,7 @@ remoteConfigParser c -- cases the lenient parser will do the same thing as the strict -- parser. | M.null (M.filter isproposed c) = return lenientRemoteConfigParser - | otherwise = case parseRemoteConfig c lenientRemoteConfigParser of + | otherwise = case parseRemoteConfig c baseRemoteConfigParser of Left _ -> return lenientRemoteConfigParser Right pc -> case (getRemoteConfigValue externaltypeField pc, getRemoteConfigValue readonlyField pc) of (Nothing, _) -> return lenientRemoteConfigParser