summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Sbuild.hs
diff options
context:
space:
mode:
authorSean Whitton2016-05-17 12:09:45 -0700
committerSean Whitton2016-05-17 12:09:45 -0700
commitdb0245d9d96c4235563e4314102b114b028d72d0 (patch)
treef4281cbba73e814ac29d0766f14b726593334eef /src/Propellor/Property/Sbuild.hs
parent80ef1acd5e86e91c47b90345e24fa4a9701cf8a9 (diff)
re-insert build code
Diffstat (limited to 'src/Propellor/Property/Sbuild.hs')
-rw-r--r--src/Propellor/Property/Sbuild.hs39
1 files changed, 18 insertions, 21 deletions
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