summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Debootstrap.hs
diff options
context:
space:
mode:
authorJoey Hess2016-03-28 04:46:21 -0400
committerJoey Hess2016-03-28 04:46:21 -0400
commit5f41492d8afe6ac6ee3cc280c3e2f252bcc91817 (patch)
tree6c9d91f7a13f35514f98564954273051ecc6a641 /src/Propellor/Property/Debootstrap.hs
parent67a1bb6d9915a0c36b71d984cf0ef4c89dd59607 (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property/Debootstrap.hs')
-rw-r--r--src/Propellor/Property/Debootstrap.hs19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs
index fd5f6c96..e0c56966 100644
--- a/src/Propellor/Property/Debootstrap.hs
+++ b/src/Propellor/Property/Debootstrap.hs
@@ -101,21 +101,12 @@ extractSuite (System (FreeBSD _) _) = Nothing
installed :: RevertableProperty Linux Linux
installed = install <!> remove
where
- install = withOS "debootstrap installed" $ \w o ->
- ifM (liftIO $ isJust <$> programPath)
- ( return NoChange
- , ensureProperty w (installon o)
- )
-
- installon (Just (System (Debian _) _)) = aptinstall
- installon (Just (System (Buntish _) _)) = aptinstall
- installon _ = sourceInstall
+ install = check (isJust <$> programPath) $
+ (aptinstall `pickOS` sourceInstall)
+ `describe` "debootstrap installed"
- remove = withOS "debootstrap removed" $ \w o ->
- ensureProperty w (removefrom o)
- removefrom (Just (System (Debian _) _)) = aptremove
- removefrom (Just (System (Buntish _) _)) = aptremove
- removefrom _ = sourceRemove
+ remove = (aptremove `pickOS` sourceRemove)
+ `describe` "debootstrap removed"
aptinstall = Apt.installed ["debootstrap"]
aptremove = Apt.removed ["debootstrap"]