diff --git a/Utility/Gpg.hs b/Utility/Gpg.hs index 650ef450ee..e5796dd55a 100644 --- a/Utility/Gpg.hs +++ b/Utility/Gpg.hs @@ -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 diff --git a/Utility/SafeCommand.hs b/Utility/SafeCommand.hs index bb467aca3f..51e151e0f3 100644 --- a/Utility/SafeCommand.hs +++ b/Utility/SafeCommand.hs @@ -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