summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Apt.hs
diff options
context:
space:
mode:
authorJoey Hess2017-11-22 14:42:03 -0400
committerJoey Hess2017-11-22 14:42:03 -0400
commit1ba03e425ca48aa9d9c32861681c9e5b70abe881 (patch)
tree2f162520589c649978a9986e8cce9e2e39c0e96c /src/Propellor/Property/Apt.hs
parent85a6ca99ac40d521b3634af6f4f8c9f8b227a0ff (diff)
parenteebdd018cd4c3054c258eeb7a6b304b263d62a74 (diff)
Merge branch 'master' into joeyconfig
Diffstat (limited to 'src/Propellor/Property/Apt.hs')
-rw-r--r--src/Propellor/Property/Apt.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs
index 68ebe89e..d44b5c38 100644
--- a/src/Propellor/Property/Apt.hs
+++ b/src/Propellor/Property/Apt.hs
@@ -501,12 +501,16 @@ dpkgStatus = "/var/lib/dpkg/status"
-- | Set apt's proxy
proxy :: Url -> Property (HasInfo + DebianLike)
-proxy u = tightenTargets $
- proxyInfo `before` proxyConfig `describe` desc
+proxy u = setInfoProperty (proxy' u) (proxyInfo u)
where
- proxyInfo = pureInfoProperty desc (InfoVal (HostAptProxy u))
- proxyConfig = "/etc/apt/apt.conf.d/20proxy" `File.hasContent`
+ proxyInfo = toInfo . InfoVal . HostAptProxy
+
+proxy' :: Url -> Property DebianLike
+proxy' u = tightenTargets $
+ "/etc/apt/apt.conf.d/20proxy" `File.hasContent`
[ "Acquire::HTTP::Proxy \"" ++ u ++ "\";" ]
+ `describe` desc
+ where
desc = (u ++ " apt proxy selected")
-- | Cause apt to proxy downloads via an apt cacher on localhost