From 695f3f1aa70468671dc09894324d92f23d5283ae Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 5 Sep 2016 11:27:41 -0700 Subject: schroot config additions now ensured on each spin Previously, they were only ensured when first building the schroot. --- src/Propellor/Property/Sbuild.hs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/Propellor/Property/Sbuild.hs') diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs index d385b2a6..c05f47e7 100644 --- a/src/Propellor/Property/Sbuild.hs +++ b/src/Propellor/Property/Sbuild.hs @@ -136,7 +136,7 @@ builtFor sys = go deleted -- | Build and configure a schroot for use with sbuild built :: SbuildSchroot -> Apt.Url -> RevertableProperty DebianLike UnixLike built s@(SbuildSchroot suite arch) mirror = - (go + ((go `before` enhancedConf) `requires` ccachePrepared `requires` installed `requires` overlaysKernel) @@ -157,10 +157,7 @@ built s@(SbuildSchroot suite arch) mirror = ] ifM (liftIO $ boolSystemEnv "sbuild-createchroot" params (Just de)) - ( ensureProperty w $ - fixConfFile s - `before` aliasesLine - `before` commandPrefix + ( ensureProperty w $ fixConfFile s , return FailedChange ) -- TODO we should kill any sessions still using the chroot @@ -172,6 +169,16 @@ built s@(SbuildSchroot suite arch) mirror = ("/etc/sbuild/chroot" show s ++ "-sbuild") makeChange $ nukeFile (schrootConf s) + enhancedConf = + combineProperties ("enhanced schroot conf for " ++ show s) $ props + & aliasesLine + -- enable ccache and eatmydata for speed + & ConfFile.containsIniSetting (schrootConf s) + [ show s ++ "-sbuild" + , "command-prefix" + , "/var/cache/ccache-sbuild/sbuild-setup,eatmydata" + ] + -- if we're building a sid chroot, add useful aliases -- In order to avoid more than one schroot getting the same aliases, we -- only do this if the arch of the chroot equals the host arch. @@ -186,10 +193,6 @@ built s@(SbuildSchroot suite arch) mirror = schrootConf s `File.containsLine` aliases else return NoChange - -- enable ccache and eatmydata for speed - commandPrefix = File.containsLine (schrootConf s) - "command-prefix=/var/cache/ccache-sbuild/sbuild-setup,eatmydata" - -- If the user has indicated that this host should use -- union-type=overlay schroots, we need to ensure that we have rebooted -- to a kernel supporting OverlayFS before we execute -- cgit v1.2.3