summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/File.hs
diff options
context:
space:
mode:
authorJoey Hess2015-12-05 17:53:32 -0400
committerJoey Hess2015-12-05 17:53:32 -0400
commit97a224b194b96184c7938de0bb1e1f423612ccbc (patch)
tree7cc147c4726af8644510c07ba87597920f8301dc /src/Propellor/Property/File.hs
parent5c6a43c3b888242443d790efbc1f9282e4e5675c (diff)
parent12548bae3d8feecce6a322162d91b827289ae824 (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property/File.hs')
-rw-r--r--src/Propellor/Property/File.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Propellor/Property/File.hs b/src/Propellor/Property/File.hs
index e29eceb8..56066b5b 100644
--- a/src/Propellor/Property/File.hs
+++ b/src/Propellor/Property/File.hs
@@ -158,19 +158,19 @@ f `isCopyOf` f' = property desc $ go =<< (liftIO $ tryIO $ getFileStatus f')
-- | Ensures that a file/dir has the specified owner and group.
ownerGroup :: FilePath -> User -> Group -> Property NoInfo
-ownerGroup f (User owner) (Group group) = property (f ++ " owner " ++ og) $ do
- r <- ensureProperty $ cmdProperty "chown" [og, f]
- if r == FailedChange
- then return r
- else noChange
+ownerGroup f (User owner) (Group group) = p `describe` (f ++ " owner " ++ og)
where
+ p = cmdProperty "chown" [og, f]
+ `changesFile` f
og = owner ++ ":" ++ group
-- | Ensures that a file/dir has the specfied mode.
mode :: FilePath -> FileMode -> Property NoInfo
-mode f v = property (f ++ " mode " ++ show v) $ do
- liftIO $ modifyFileMode f (const v)
- noChange
+mode f v = p `changesFile` f
+ where
+ p = property (f ++ " mode " ++ show v) $ do
+ liftIO $ modifyFileMode f (const v)
+ return NoChange
-- | A temp file to use when writing new content for a file.
--