From 57b084713497bf16a59cc0769148bfad7c7cea71 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Nov 2017 14:32:40 -0700 Subject: prevent Sbuilt.useHostProxy from looping by not peeking too early --- src/Propellor/Property/Apt.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/Propellor/Property/Apt.hs') 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 -- cgit v1.2.3