summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Sbuild.hs
diff options
context:
space:
mode:
authorSean Whitton2016-05-20 06:22:11 +0900
committerSean Whitton2016-05-20 06:22:11 +0900
commit714cb4e3425b61b204589ceeb7eb63fcd2b7d4e4 (patch)
treecb0619377233720b986d9593bc439bf6323e9f09 /src/Propellor/Property/Sbuild.hs
parent7bf451618e49e68bce7e9b6a75f09e3e5943df5e (diff)
move fixConfFile into the propellor monad
Diffstat (limited to 'src/Propellor/Property/Sbuild.hs')
-rw-r--r--src/Propellor/Property/Sbuild.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs
index cb19d525..8b0748e4 100644
--- a/src/Propellor/Property/Sbuild.hs
+++ b/src/Propellor/Property/Sbuild.hs
@@ -158,11 +158,15 @@ updated s@(SbuildSchroot suite arch) =
--
-- The properties in this module only permit the creation of one chroot for a
-- given suite and architecture, so we don't need the suffix to be random.
-fixConfFile :: SbuildSchroot -> IO ()
-fixConfFile s@(SbuildSchroot suite arch) = do
- old <- concat . filter (tempPrefix `isPrefixOf`) <$> dirContents dir
- ensureProperty $ File.fileProperty "replace dummy suffix" (map munge) old
- moveFile old new
+fixConfFile :: SbuildSchroot -> Property UnixLike
+fixConfFile s@(SbuildSchroot suite arch) =
+ property' ("schroot for " ++ show s ++ " config file fixed") $ \w -> do
+ confs <- liftIO $ dirContents dir
+ let old = concat $ filter (tempPrefix `isPrefixOf`) confs
+ ensureProperty w $
+ File.fileProperty "replace dummy suffix" (map munge) old
+ liftIO $ moveFile old new
+ return MadeChange
where
new = schrootConf s
dir = takeDirectory new