summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Sbuild.hs
diff options
context:
space:
mode:
authorSean Whitton2016-09-05 14:15:16 -0700
committerSean Whitton2016-09-05 14:16:42 -0700
commit5558632f37eb036c80e541b04128ad5eb6b5f4e9 (patch)
tree0aaa5a76c800d94a07eb8d897149f99c83b0f895 /src/Propellor/Property/Sbuild.hs
parent9283e091041d002d83dfd711d0776fa31288d5ec (diff)
piupartsConf{,For} doesn't require Sbuild.built
Instead, do nothing if the corresponding schroot config does not yet exist. This change is needed because I intend to introduce an additional parameter to Sbuild.built{,For} in a subsequent commit, and it would overcomplicate things to make that an item of Info.
Diffstat (limited to 'src/Propellor/Property/Sbuild.hs')
-rw-r--r--src/Propellor/Property/Sbuild.hs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs
index 909aae65..35b73ec6 100644
--- a/src/Propellor/Property/Sbuild.hs
+++ b/src/Propellor/Property/Sbuild.hs
@@ -292,9 +292,8 @@ fixConfFile s@(SbuildSchroot suite arch) =
-- documentation for why you might want to use this property, and sample config.
piupartsConfFor :: System -> Property DebianLike
piupartsConfFor sys = property' ("piuparts schroot conf for " ++ show sys) $
- \w -> case (schrootFromSystem sys, stdMirror sys) of
- (Just s, Just u) -> ensureProperty w $
- piupartsConf s u
+ \w -> case schrootFromSystem sys of
+ Just s -> ensureProperty w $ piupartsConf s
_ -> errorMessage
("don't know how to debootstrap " ++ show sys)
@@ -319,9 +318,13 @@ piupartsConfFor sys = property' ("piuparts schroot conf for " ++ show sys) $
-- > '--fail-if-inadequate',
-- > '--fail-on-broken-symlinks',
-- > ];
-piupartsConf :: SbuildSchroot -> Apt.Url -> Property DebianLike
-piupartsConf s@(SbuildSchroot _ arch) u = go
- `requires` (setupRevertableProperty $ built s u)
+--
+-- This property has no effect if the corresponding sbuild schroot does not
+-- exist (i.e. you also need 'Sbuild.built' or 'Sbuild.builtFor').
+piupartsConf :: SbuildSchroot -> Property DebianLike
+piupartsConf s@(SbuildSchroot _ arch) =
+ check (doesFileExist (schrootConf s)) go
+ `requires` installed
where
go :: Property DebianLike
go = property' desc $ \w -> do