summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Sbuild.hs
diff options
context:
space:
mode:
authorSean Whitton2019-11-12 14:55:43 -0700
committerJoey Hess2019-11-13 10:17:56 -0400
commite7e94a8f57dd6a54213cbc1365928110e95f8947 (patch)
tree545de7c8c876e23b52f0d3a4e7d9fdfba6e6d75f /src/Propellor/Property/Sbuild.hs
parent0ce27912fb2371590e6a1c44f76f51f408d9b79f (diff)
move Sbuild.useHostProxy -> Chroot.useHostProxy
Now that the apt proxy is respected by Chroot.debootstrapped, users will probably want to apply useHostProxy to more chroots than just sbuild schroots. Unfortunately, we can't have a corresponding Chroot.useHostMirror property, because the only sensible way to set the chroot's apt mirror is to use the Apt.mirror pure info property, but we can't ensure properties with info. Suggested-by: Joey Hess <id@joeyh.name> Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/Propellor/Property/Sbuild.hs')
-rw-r--r--src/Propellor/Property/Sbuild.hs17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs
index 1562f80e..3242014d 100644
--- a/src/Propellor/Property/Sbuild.hs
+++ b/src/Propellor/Property/Sbuild.hs
@@ -31,7 +31,7 @@ Suggested usage in @config.hs@:
> & osDebian Unstable X86_32
> & Sbuild.osDebianStandard
> & Sbuild.update `period` Weekly (Just 1)
-> & Sbuild.useHostProxy mybox
+> & Chroot.useHostProxy mybox
If you are using sbuild older than 0.70.0, you also need:
@@ -65,7 +65,6 @@ module Propellor.Property.Sbuild (
built,
-- * Properties for use inside sbuild schroots
update,
- useHostProxy,
osDebianStandard,
-- * Global sbuild configuration
-- blockNetwork,
@@ -268,20 +267,6 @@ osDebianStandard = propertyList "standard Debian sbuild properties" $ props
update :: Property DebianLike
update = Apt.update `before` Apt.upgrade `before` Apt.autoRemove
--- | Ensure that an sbuild schroot uses the host's Apt proxy.
---
--- This property is typically used when the host has 'Apt.useLocalCacher'.
-useHostProxy :: Host -> Property DebianLike
-useHostProxy h = property' "use host's apt proxy" $ \w ->
- -- Note that we can't look at getProxyInfo outside the property,
- -- as that would loop, but it's ok to look at it inside the
- -- property. Thus the slightly strange construction here.
- case getProxyInfo of
- Just (Apt.HostAptProxy u) -> ensureProperty w (Apt.proxy' u)
- Nothing -> noChange
- where
- getProxyInfo = fromInfoVal . fromInfo . hostInfo $ h
-
aptCacheLine :: String
aptCacheLine = "/var/cache/apt/archives /var/cache/apt/archives none rw,bind 0 0"