summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Chroot.hs
diff options
context:
space:
mode:
authorJoey Hess2017-04-10 11:12:17 -0400
committerJoey Hess2017-04-10 11:12:17 -0400
commit03950541b77405b8822dd2cadb47bc249a2bb5d3 (patch)
tree26cf2669776118e7e0ab481377b223eb578c7845 /src/Propellor/Property/Chroot.hs
parent983ee62929037c7297e2281ea3910e94a85bead5 (diff)
copy git configuration into chroot
Diffstat (limited to 'src/Propellor/Property/Chroot.hs')
-rw-r--r--src/Propellor/Property/Chroot.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs
index 96c75846..5f764d47 100644
--- a/src/Propellor/Property/Chroot.hs
+++ b/src/Propellor/Property/Chroot.hs
@@ -304,17 +304,17 @@ newtype InChroot = InChroot Bool
-- to a temp directory, to preserve access to the original bind mount. Then
-- we unmount the localdir to expose the true localdir. Finally, to cleanup,
-- the temp directory is bind mounted back to the localdir.
-exposeTrueLocaldir :: (FilePath -> IO a) -> Propellor a
+exposeTrueLocaldir :: (FilePath -> Propellor a) -> Propellor a
exposeTrueLocaldir a = ifM inChroot
- ( liftIO $ withTmpDirIn (takeDirectory localdir) "propellor.tmp" $ \tmpdir ->
+ ( withTmpDirIn (takeDirectory localdir) "propellor.tmp" $ \tmpdir ->
bracket_
(movebindmount localdir tmpdir)
(movebindmount tmpdir localdir)
(a tmpdir)
- , liftIO $ a localdir
+ , a localdir
)
where
- movebindmount from to = do
+ movebindmount from to = liftIO $ do
run "mount" [Param "--bind", File from, File to]
-- Have to lazy unmount, because the propellor process
-- is running in the localdir that it's unmounting..