summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Apt.hs
diff options
context:
space:
mode:
authorFélix Sipma2014-11-11 22:37:39 +0100
committerJoey Hess2014-11-11 19:57:39 -0400
commit9d6a79bc23fbf75033a8a29549c95829828e1f05 (patch)
treeb3f760c1c66cc6c5ecf901c515125bac77768e8e /src/Propellor/Property/Apt.hs
parent499cebd3c788b0a168e3e2a4121f8ce447b97acd (diff)
Apt: stable-updates suite
Signed-off-by: Félix Sipma <felix.sipma@no-log.org>
Diffstat (limited to 'src/Propellor/Property/Apt.hs')
-rw-r--r--src/Propellor/Property/Apt.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs
index 7cf6c2b0..471d6195 100644
--- a/src/Propellor/Property/Apt.hs
+++ b/src/Propellor/Property/Apt.hs
@@ -29,6 +29,10 @@ backportSuite :: DebianSuite -> Maybe String
backportSuite (Stable s) = Just (s ++ "-backports")
backportSuite _ = Nothing
+stableUpdatesSuite :: DebianSuite -> Maybe String
+stableUpdatesSuite (Stable s) = Just (s ++ "-updates")
+stableUpdatesSuite _ = Nothing
+
debLine :: String -> Url -> [Section] -> Line
debLine suite mirror sections = unwords $
["deb", mirror, suite] ++ sections
@@ -74,9 +78,9 @@ securityUpdates suite
-- Since the CDN is sometimes unreliable, also adds backup lines using
-- kernel.org.
stdSourcesList :: Property
-stdSourcesList = withOS ("standard sources.list") $ \o ->
+stdSourcesList = withOS ("standard sources.list") $ \o ->
case o of
- (Just (System (Debian suite) _)) ->
+ (Just (System (Debian suite) _)) ->
ensureProperty $ stdSourcesListFor suite
_ -> error "os is not declared to be Debian"
@@ -135,7 +139,7 @@ installedBackport ps = trivial $ withOS desc $ \o -> case o of
Nothing -> error "cannot install backports; os not declared"
(Just (System (Debian suite) _)) -> case backportSuite suite of
Nothing -> notsupported o
- Just bs -> ensureProperty $ runApt $
+ Just bs -> ensureProperty $ runApt $
["install", "-t", bs, "-y"] ++ ps
_ -> notsupported o
where
@@ -218,7 +222,7 @@ unattendedUpgrades = RevertableProperty enable disable
v
| enabled = "true"
| otherwise = "false"
-
+
configure = withOS "unattended upgrades configured" $ \o ->
case o of
-- the package defaults to only upgrading stable
@@ -272,4 +276,4 @@ trustsKey k = RevertableProperty trust untrust
-- space.
cacheCleaned :: Property
cacheCleaned = trivial $ cmdProperty "apt-get" ["clean"]
- `describe` "apt cache cleaned"
+ `describe` "apt cache cleaned"