From db0245d9d96c4235563e4314102b114b028d72d0 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 17 May 2016 12:09:45 -0700 Subject: re-insert build code --- src/Propellor/Property/Sbuild.hs | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs index 5f182881..8f6629fb 100644 --- a/src/Propellor/Property/Sbuild.hs +++ b/src/Propellor/Property/Sbuild.hs @@ -77,12 +77,30 @@ builtFor system = case schrootFromSystem system of Just s -> built s (stdMirror system) Nothing -> errorMessage "don't know how to debootstrap " ++ show system +-- TODO should be revertable (and that should carry through to builtFor) -- | Build and configure a schroot for use with sbuild built :: SbuildSchroot -> Apt.Url -> Property DebianLike built s mirror = check (not <$> doesDirectoryExist (schrootRoot s)) $ property ("built schroot for " ++ show s) go `requires` keypairGenerated `requires` installed + where + go :: Property DebianLike + go = do + de <- standardPathEnv + let params = Param <$> + [ "--arch=" ++ arch + , "--chroot-suffix=propellor" + , "--include=eatmydata,ccache" + , schrootRoot s + , mirror + ] + ifM (boolSystemEnv "sbuild-createchroot" params (Just de)) + ( do + fixConfFile s + return MadeChange + , return FailedChange + ) -- | Ensure that an sbuild schroot's packages and apt indexes are updated -- @@ -105,27 +123,6 @@ updated s@(SbuildSchroot suite arch) = go = tightenTargets $ cmdProperty "sbuild-update" ["-udr", suite ++ "-" ++ arch] --- go = do --- suite <- case extractSuite system of --- Just s -> return s --- Nothing -> errorMessage $ --- "don't know how to debootstrap " ++ show system --- de <- standardPathEnv --- let params = Param <$> --- [ "--arch=" ++ arch --- , "--chroot-suffix=propellor" --- , "--include=eatmydata,ccache" --- , schrootLocation suite arch --- , stdMirror distro --- ] --- ifM (boolSystemEnv "sbuild-createchroot" params (Just de)) --- ( do --- fixConfFile suite arch --- return MadeChange --- , return FailedChange --- ) - - -- Find the conf file that sbuild-createchroot(1) made when we passed it -- --chroot-suffix=propellor, and edit and rename such that it is as if we -- passed --chroot-suffix=sbuild (the default). Replace the random suffix with -- cgit v1.2.3