From c6e1829e4f5ff75a04300e2fe6fb5633a60348af Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 20 May 2016 07:38:39 +0900 Subject: use Maybe for stdMirror --- src/Propellor/Property/Sbuild.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/Propellor/Property/Sbuild.hs') 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 -- cgit v1.2.3