diff options
| author | Joey Hess <joeyh@joeyh.name> | 2017-11-21 16:29:42 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2017-11-21 16:29:42 -0400 |
| commit | 462f0fd693554285afb149faf4ae5dbe798fda54 (patch) | |
| tree | 1349a31fde27c421d2941cd0ca6c60359b286307 /src/Propellor/Property/Apt.hs | |
| parent | a19980ea1ae0a7287fd3658e09712d4123f6332e (diff) | |
| parent | 33dab96764e04dc2bfbec44c54062c3b6ee60554 (diff) | |
Merge remote-tracking branch 'spwhitton/sbuild-overhaul'
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 |
