diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2016-05-20 07:38:39 +0900 |
|---|---|---|
| committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-05-20 07:38:39 +0900 |
| commit | c6e1829e4f5ff75a04300e2fe6fb5633a60348af (patch) | |
| tree | 8ed85fac11d29517a30e62a61bb44019fb1d7498 /src | |
| parent | a656f0f1b050e5787883172a750f32d0bd5a6545 (diff) | |
use Maybe for stdMirror
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Sbuild.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs index 49741ac1..7f53d5b6 100644 --- a/src/Propellor/Property/Sbuild.hs +++ b/src/Propellor/Property/Sbuild.hs @@ -89,11 +89,10 @@ builtFor :: System -> RevertableProperty DebianLike UnixLike builtFor system = go <!> deleted where go = property' ("sbuild schroot for " ++ show system) $ - \w -> case schrootFromSystem system of - Just s -> ensureProperty w $ - setupRevertableProperty $ - built s (stdMirror system) - Nothing -> errorMessage + \w -> case (schrootFromSystem system, stdMirror system) of + (Just s, Just u) -> ensureProperty w $ + setupRevertableProperty $ built s u + _ -> errorMessage ("don't know how to debootstrap " ++ show system) deleted = property' ("no sbuild schroot for " ++ show system) $ \w -> case schrootFromSystem system of @@ -258,9 +257,10 @@ schrootFromSystem system@(System _ arch) = extractSuite system >>= \suite -> return $ SbuildSchroot suite arch -stdMirror :: System -> Apt.Url -stdMirror (System (Debian _) _) = "http://httpredir.debian.org/debian" -stdMirror (System (Buntish _) _) = "mirror://mirrors.ubuntu.com/" +stdMirror :: System -> Maybe Apt.Url +stdMirror (System (Debian _) _) = Just "http://httpredir.debian.org/debian" +stdMirror (System (Buntish _) _) = Just "mirror://mirrors.ubuntu.com/" +stdMirror _ = Nothing schrootRoot :: SbuildSchroot -> FilePath schrootRoot (SbuildSchroot s a) = "/srv/chroot" </> s ++ "-" ++ a |
