summaryrefslogtreecommitdiff
path: root/src/Propellor/Property
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Property')
-rw-r--r--src/Propellor/Property/Chroot.hs16
-rw-r--r--src/Propellor/Property/Sbuild.hs17
2 files changed, 17 insertions, 16 deletions
diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs
index ddb7f884..971fd8ba 100644
--- a/src/Propellor/Property/Chroot.hs
+++ b/src/Propellor/Property/Chroot.hs
@@ -10,6 +10,7 @@ module Propellor.Property.Chroot (
Debootstrapped(..),
ChrootTarball(..),
exposeTrueLocaldir,
+ useHostProxy,
-- * Internal use
provisioned',
propagateChrootInfo,
@@ -333,3 +334,18 @@ propagateHostChrootInfo :: Host -> InfoPropagator
propagateHostChrootInfo h c pinfo p =
propagateContainer (hostName h) c pinfo $
p `setInfoProperty` chrootInfo c
+
+-- | Ensure that a chroot uses the host's Apt proxy.
+--
+-- This property is often used for 'Sbuild.built' chroots, 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
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"