diff options
| author | Joey Hess <joeyh@joeyh.name> | 2017-11-20 14:32:40 -0700 |
|---|---|---|
| committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-11-20 14:32:40 -0700 |
| commit | 57b084713497bf16a59cc0769148bfad7c7cea71 (patch) | |
| tree | 579cdaa3be43daac1a60527c7f3065f51bee77ad /src/Propellor/Property/Apt.hs | |
| parent | 1aaf9c5b080058617d0204219d1c101a345dc6fb (diff) | |
prevent Sbuilt.useHostProxy from looping by not peeking too early
Diffstat (limited to 'src/Propellor/Property/Apt.hs')
| -rw-r--r-- | src/Propellor/Property/Apt.hs | 12 |
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 |
