summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorJoey Hess2015-12-17 13:29:54 -0400
committerJoey Hess2015-12-17 13:29:54 -0400
commit4e4c7bb914779ded627bc28de116acd8b0867986 (patch)
tree0b33bbffa6a59f5f058f9d458b4f9e53c969a724 /src/Propellor
parent6fd93bf8e85a90cc3b241426a7feda7b70648961 (diff)
minor tweak
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Property/Gpg.hs12
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"