From 804622719b8a348bfdd32f427502e0529d50a8ed Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 1 Sep 2015 11:24:02 -0700 Subject: removal of chroot on disk image rebuild --- src/Propellor/Property/DiskImage.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Propellor/Property/DiskImage.hs') diff --git a/src/Propellor/Property/DiskImage.hs b/src/Propellor/Property/DiskImage.hs index f649b7bb..54fa8945 100644 --- a/src/Propellor/Property/DiskImage.hs +++ b/src/Propellor/Property/DiskImage.hs @@ -15,6 +15,7 @@ module Propellor.Property.DiskImage ( import Propellor import Propellor.Property.Chroot (Chroot) +import Propellor.Property.Chroot.Util (removeChroot) import qualified Propellor.Property.Chroot as Chroot import Propellor.Property.Parted import qualified Propellor.Property.Grub as Grub @@ -56,6 +57,7 @@ built' :: Bool -> FilePath -> (FilePath -> Chroot) -> MkPartTable -> DiskImageFi built' rebuild img mkchroot mkparttable final = (mkimg unmkimg) `requires` Chroot.provisioned (mkchroot chrootdir) + `requires` (handlerebuild doNothing) `describe` desc where desc = "built disk image " ++ img @@ -70,6 +72,11 @@ built' rebuild img mkchroot mkparttable final = exists img disksz `before` partitioned YesReallyDeleteDiskContents img t + handlerebuild + | rebuild = property desc $ do + liftIO $ removeChroot chrootdir + return MadeChange + | otherwise = doNothing -- | Ensures that a disk image file of the specified size exists. -- -- cgit v1.3-2-g0d8e