summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Sbuild.hs
diff options
context:
space:
mode:
authorSean Whitton2016-05-20 07:20:17 +0900
committerSean Whitton2016-05-20 07:20:17 +0900
commitaf1be336d79c9dbf159aac0cc35078cf20156bfe (patch)
tree238c6fee77e52e715fad076b2009476d72e7667e /src/Propellor/Property/Sbuild.hs
parentb97bc4aa6d679cba670c1445eb5696e3d261a7c1 (diff)
fix types in Sbuild.built
Diffstat (limited to 'src/Propellor/Property/Sbuild.hs')
-rw-r--r--src/Propellor/Property/Sbuild.hs30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs
index e0d8abea..a674ea16 100644
--- a/src/Propellor/Property/Sbuild.hs
+++ b/src/Propellor/Property/Sbuild.hs
@@ -1,4 +1,5 @@
{-# OPTIONS_HADDOCK prune #-}
+{-# LANGUAGE TypeFamilies #-}
{-|
Maintainer: Sean Whitton <spwhitton@spwhitton.name>
@@ -99,16 +100,15 @@ builtFor system = go <!> deleted
-- | Build and configure a schroot for use with sbuild
built :: SbuildSchroot -> Apt.Url -> RevertableProperty DebianLike UnixLike
-built s@(SbuildSchroot suite arch) mirror = built <!> deleted
+built s@(SbuildSchroot suite arch) mirror =
+ (built `requires` keypairGenerated `requires` ccachePrepared `requires` installed)
+ <!> deleted
where
+ built :: Property DebianLike
built = check (not <$> doesDirectoryExist (schrootRoot s)) $
- property ("built sbuild schroot for " ++ show s) go
- `requires` keypairGenerated
- `requires` ccachePrepared
- `requires` installed
- go :: Property DebianLike
- go = do
- de <- standardPathEnv
+ property' ("built sbuild schroot for " ++ show s) go
+ go w = do
+ de <- liftIO standardPathEnv
let params = Param <$>
[ "--arch=" ++ arch
, "--chroot-suffix=propellor"
@@ -116,15 +116,17 @@ built s@(SbuildSchroot suite arch) mirror = built <!> deleted
, schrootRoot s
, mirror
]
- ifM (boolSystemEnv "sbuild-createchroot" params (Just de))
+ ifM (liftIO $ boolSystemEnv "sbuild-createchroot" params (Just de))
( do
- fixConfFile s
+ ensureProperty w $ fixConfFile s
-- if we just built a sid chroot, add useful aliases
- when (suite == "unstable") $ ensureProperty $
- File.containsLine (schrootConf s)
- "aliases=UNRELEASED,sid,rc-buggy,experimental"
+ if suite == "unstable"
+ then ensureProperty w $
+ File.containsLine (schrootConf s)
+ "aliases=UNRELEASED,sid,rc-buggy,experimental"
+ else noChange
-- enable ccache and eatmydata for speed
- ensureProperty $ File.containsLine (schrootConf s)
+ ensureProperty w $ File.containsLine (schrootConf s)
"command-prefix=/var/cache/ccache-sbuild/sbuild-setup,eatmydata"
return MadeChange
, return FailedChange