diff options
| author | Joey Hess <joey@kitenet.net> | 2014-11-11 12:58:53 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-11-11 12:58:53 -0400 |
| commit | 84304821bebf9b794fae56f616b50ae1d06014d2 (patch) | |
| tree | e43b936fc51e9c2bb75399cd23885dcb8b4b661c /src/Propellor/Keyring.hs | |
| parent | f559ccaf738535ad4b0ebb0b520542055d8ae305 (diff) | |
propellor spin
Diffstat (limited to 'src/Propellor/Keyring.hs')
| -rw-r--r-- | src/Propellor/Keyring.hs | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/Propellor/Keyring.hs b/src/Propellor/Keyring.hs deleted file mode 100644 index c3018eb9..00000000 --- a/src/Propellor/Keyring.hs +++ /dev/null @@ -1,50 +0,0 @@ -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 - gpg = do - createDirectoryIfMissing True privDataDir - boolSystem "sh" - [ Param "-c" - , Param $ "gpg --export " ++ keyid ++ " | gpg " ++ - unwords (gpgopts ++ ["--import"]) - ] - gitadd = boolSystem "git" - [ Param "add" - , File keyring - ] - - gitconfig = boolSystem "git" - [ Param "config" - , Param "user.signingkey" - , Param keyid - ] - - gitcommit = gitCommit - [ File keyring - , Param "-m" - , 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 - k <- doesFileExist keyring - boolSystem "git" $ catMaybes $ - [ Just (Param "commit") - , if k then Just (Param "--gpg-sign") else Nothing - ] ++ map Just ps |
