diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-12-17 13:29:54 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-12-17 13:29:54 -0400 |
| commit | 4e4c7bb914779ded627bc28de116acd8b0867986 (patch) | |
| tree | 0b33bbffa6a59f5f058f9d458b4f9e53c969a724 /src | |
| parent | 6fd93bf8e85a90cc3b241426a7feda7b70648961 (diff) | |
minor tweak
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Gpg.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Propellor/Property/Gpg.hs b/src/Propellor/Property/Gpg.hs index 0f1c70ea..bd710ca7 100644 --- a/src/Propellor/Property/Gpg.hs +++ b/src/Propellor/Property/Gpg.hs @@ -31,7 +31,7 @@ keyImported key@(GpgKeyId keyid) user@(User u) = prop property desc $ getkey $ \key' -> do let keylines = privDataLines key' ifM (liftIO $ hasGpgKey (parse keylines)) - (return NoChange + ( return NoChange , makeChange $ withHandle StdinHandle createProcessSuccess (proc "su" ["-c", "gpg --import", u]) $ \h -> do fileEncoding h @@ -48,11 +48,6 @@ keyImported key@(GpgKeyId keyid) user@(User u) = prop hasGpgKey (Just GpgPubKey) = hasPubKey key user hasGpgKey (Just GpgPrivKey) = hasPrivKey key user -dotDir :: User -> IO FilePath -dotDir (User u) = do - home <- homeDirectory <$> getUserEntryForName u - return $ home </> ".gnupg" - hasPrivKey :: GpgKeyId -> User -> IO Bool hasPrivKey (GpgKeyId keyid) (User u) = catchBoolIO $ snd <$> processTranscript "su" ["-c", "gpg --list-secret-keys " ++ shellEscape keyid, u] Nothing @@ -60,3 +55,8 @@ hasPrivKey (GpgKeyId keyid) (User u) = catchBoolIO $ hasPubKey :: GpgKeyId -> User -> IO Bool hasPubKey (GpgKeyId keyid) (User u) = catchBoolIO $ snd <$> processTranscript "su" ["-c", "gpg --list-public-keys " ++ shellEscape keyid, u] Nothing + +dotDir :: User -> IO FilePath +dotDir (User u) = do + home <- homeDirectory <$> getUserEntryForName u + return $ home </> ".gnupg" |
