summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton2018-05-02 10:35:48 -0700
committerJoey Hess2018-05-02 17:08:08 -0400
commit09191ed1fde898d69bf7f3862bd8400db84eff66 (patch)
treec07308d2b22cf4a1e85c331de05197ff33229321
parent5541473c69a9cfc9564644d9757f3836ff99c3c3 (diff)
make Schroot.overlaysInTmpfs revertable
Useful when a build fails on a tmpfs (usually a package's test suite). Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/Propellor/Property/Schroot.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Propellor/Property/Schroot.hs b/src/Propellor/Property/Schroot.hs
index bb20f6e6..2f399b7c 100644
--- a/src/Propellor/Property/Schroot.hs
+++ b/src/Propellor/Property/Schroot.hs
@@ -32,8 +32,8 @@ usesOverlays = isJust . fromInfoVal
-- Implicitly sets 'useOverlays' info property.
--
-- Shell script from <https://wiki.debian.org/sbuild>.
-overlaysInTmpfs :: Property (HasInfo + DebianLike)
-overlaysInTmpfs = go `requires` installed
+overlaysInTmpfs :: RevertableProperty (HasInfo + DebianLike) UnixLike
+overlaysInTmpfs = (go `requires` installed) <!> undo
where
f = "/etc/schroot/setup.d/04tmpfs"
go :: Property (HasInfo + UnixLike)
@@ -58,6 +58,7 @@ overlaysInTmpfs = go `requires` installed
, "fi"
]
`onChange` (f `File.mode` combineModes (readModes ++ executeModes))
+ undo = File.notPresent f
installed :: Property DebianLike
installed = Apt.installed ["schroot"]