summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Property/File.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Propellor/Property/File.hs b/src/Propellor/Property/File.hs
index b1e72989..8d10b94c 100644
--- a/src/Propellor/Property/File.hs
+++ b/src/Propellor/Property/File.hs
@@ -154,7 +154,10 @@ f `isCopyOf` src = property desc $ go =<< (liftIO $ tryIO $ getFileStatus src)
where
desc = f ++ " is copy of " ++ src
go (Right stat) = if isRegularFile stat
- then gocmp =<< (liftIO $ cmp)
+ then ifM (liftIO $ doesFileExist f)
+ ( gocmp =<< (liftIO $ cmp)
+ , doit
+ )
else warningMessage (src ++ " is not a regular file") >>
return FailedChange
go (Left e) = warningMessage (show e) >> return FailedChange