summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Apt.hs
diff options
context:
space:
mode:
authorSean Whitton2017-03-19 08:15:32 -0700
committerSean Whitton2017-03-19 08:15:32 -0700
commit2cdf59fadde60249491d7bb88a3625c580d2027a (patch)
tree024a48935d100fd7c367743198fcc635d9f5c264 /src/Propellor/Property/Apt.hs
parent21eaec2416dc44a9341699e0772d54397d5f5201 (diff)
add withHostMirror helper
Diffstat (limited to 'src/Propellor/Property/Apt.hs')
-rw-r--r--src/Propellor/Property/Apt.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs
index 70b9474e..29f453a9 100644
--- a/src/Propellor/Property/Apt.hs
+++ b/src/Propellor/Property/Apt.hs
@@ -33,6 +33,11 @@ getHostMirror = do
getHostMirrorInfo :: Propellor (Maybe HostMirror)
getHostMirrorInfo = fromInfoVal <$> askInfo
+withHostMirror :: Desc -> (Url -> Property DebianLike) -> Property DebianLike
+withHostMirror desc mkp = property' desc $ \w -> do
+ u <- getHostMirror
+ ensureProperty w (mkp u)
+
sourcesList :: FilePath
sourcesList = "/etc/apt/sources.list"