summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoey Hess2014-11-11 12:33:04 -0400
committerJoey Hess2014-11-11 12:33:04 -0400
commitf559ccaf738535ad4b0ebb0b520542055d8ae305 (patch)
tree3748596a48c9c06e39a1d0898196e7649b52df4a /src
parent347c02a38e120c973445195b86339ca358a0b50a (diff)
reorg
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Keyring.hs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Propellor/Keyring.hs b/src/Propellor/Keyring.hs
index 8a9c833c..c3018eb9 100644
--- a/src/Propellor/Keyring.hs
+++ b/src/Propellor/Keyring.hs
@@ -3,6 +3,9 @@ module Propellor.Keyring where
import Propellor
import Utility.SafeCommand
+keyring :: FilePath
+keyring = privDataDir </> "keyring.gpg"
+
addKey :: String -> IO ()
addKey keyid = exitBool =<< allM id [ gpg, gitadd, gitconfig, gitcommit ]
where
@@ -30,6 +33,13 @@ addKey keyid = exitBool =<< allM id [ gpg, gitadd, gitconfig, gitcommit ]
, Param "propellor addkey"
]
+ gpgopts =
+ [ "--options"
+ , "/dev/null"
+ , "--no-default-keyring"
+ , "--keyring", keyring
+ ]
+
{- Automatically sign the commit if there'a a keyring. -}
gitCommit :: [CommandParam] -> IO Bool
gitCommit ps = do
@@ -38,9 +48,3 @@ gitCommit ps = do
[ Just (Param "commit")
, if k then Just (Param "--gpg-sign") else Nothing
] ++ map Just ps
-
-keyring :: FilePath
-keyring = privDataDir </> "keyring.gpg"
-
-gpgopts :: [String]
-gpgopts = ["--options", "/dev/null", "--no-default-keyring", "--keyring", keyring]