avoid failure when gpgconf is not in path

This commit is contained in:
Joey Hess 2020-09-08 12:21:24 -04:00
parent 54404370e5
commit efd2f1a918
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 4 additions and 2 deletions

View file

@ -439,8 +439,8 @@ testHarness tmpdir cmd a = ifM (inPath (unGpgCmd cmd))
-- other daemons. Stop them when done. This only affects
-- daemons started for the GNUPGHOME that was used.
-- Older gpg may not support this, so ignore failure.
stopgpgagent = void $ boolSystem "gpgconf"
[Param "--kill", Param "all"]
stopgpgagent = whenM (inPath "gpgconf") $
void $ boolSystem "gpgconf" [Param "--kill", Param "all"]
go (Just _) = Just <$> a
go Nothing = return Nothing

View file

@ -61,6 +61,8 @@ toCommand' (File s) = s
-- | Run a system command, and returns True or False if it succeeded or failed.
--
-- (Throws an exception if the command is not found.)
--
-- This and other command running functions in this module log the commands
-- run at debug level, using System.Log.Logger.
boolSystem :: FilePath -> [CommandParam] -> IO Bool