summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Debootstrap.hs
diff options
context:
space:
mode:
authorJoey Hess2015-09-01 11:24:02 -0700
committerJoey Hess2015-09-01 11:24:02 -0700
commit804622719b8a348bfdd32f427502e0529d50a8ed (patch)
tree42a7c0be0541c177db996e03659f31cf1d86bb6d /src/Propellor/Property/Debootstrap.hs
parente85a15d160005929a9d5ea5cb21c25751856c5ae (diff)
removal of chroot on disk image rebuild
Diffstat (limited to 'src/Propellor/Property/Debootstrap.hs')
-rw-r--r--src/Propellor/Property/Debootstrap.hs11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs
index 8d974eba..a46451ef 100644
--- a/src/Propellor/Property/Debootstrap.hs
+++ b/src/Propellor/Property/Debootstrap.hs
@@ -13,7 +13,6 @@ module Propellor.Property.Debootstrap (
import Propellor
import qualified Propellor.Property.Apt as Apt
import Propellor.Property.Chroot.Util
-import Propellor.Property.Mount
import Utility.Path
import Utility.FileMode
@@ -61,7 +60,7 @@ built target system config = built' (toProp installed) target system config <!>
teardown = check (not <$> unpopulated target) teardownprop
teardownprop = property ("removed debootstrapped " ++ target) $
- makeChange (removetarget target)
+ makeChange (removeChroot target)
built' :: (Combines (Property NoInfo) (Property i)) => Property i -> FilePath -> System -> DebootstrapConfig -> Property (CInfo NoInfo i)
built' installprop target system@(System _ arch) config =
@@ -96,7 +95,7 @@ built' installprop target system@(System _ arch) config =
-- recover by deleting it and trying again.
ispartial = ifM (doesDirectoryExist (target </> "debootstrap"))
( do
- removetarget target
+ removeChroot target
return True
, return False
)
@@ -104,12 +103,6 @@ built' installprop target system@(System _ arch) config =
unpopulated :: FilePath -> IO Bool
unpopulated d = null <$> catchDefaultIO [] (dirContents d)
-removetarget :: FilePath -> IO ()
-removetarget target = do
- submnts <- mountPointsBelow target
- forM_ submnts umountLazy
- removeDirectoryRecursive target
-
extractSuite :: System -> Maybe String
extractSuite (System (Debian s) _) = Just $ Apt.showSuite s
extractSuite (System (Ubuntu r) _) = Just r