summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2014-06-01 02:53:42 -0400
committerJoey Hess2014-06-01 02:53:42 -0400
commit442dbe23119e585e2d38456a87e46b265ba3acb6 (patch)
tree9cd20b84ecaa71fe9e0064c8026aa293eb77426d
parent30440e352dd6d1b1ef36fe3a085d36149d824610 (diff)
propellor spin
-rw-r--r--config-joey.hs2
-rw-r--r--src/Propellor/Property/Apt.hs6
2 files changed, 8 insertions, 0 deletions
diff --git a/config-joey.hs b/config-joey.hs
index eca421db..026f2095 100644
--- a/config-joey.hs
+++ b/config-joey.hs
@@ -221,6 +221,7 @@ standardSystem hn suite arch = host hn
& os (System (Debian suite) arch)
& Apt.stdSourcesList suite
`onChange` Apt.upgrade
+ & Apt.cacheCleaned
& Apt.installed ["etckeeper"]
& Apt.installed ["ssh"]
& GitHome.installedFor "root"
@@ -245,6 +246,7 @@ standardContainer name suite arch = Docker.container name (dockerImage system)
& os (System (Debian suite) arch)
& Apt.stdSourcesList suite
& Apt.unattendedUpgrades
+ & Apt.cacheCleaned
where
system = System (Debian suite) arch
diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs
index d3f47a80..69144d72 100644
--- a/src/Propellor/Property/Apt.hs
+++ b/src/Propellor/Property/Apt.hs
@@ -254,3 +254,9 @@ trustsKey k = RevertableProperty trust untrust
hPutStr h (pubkey k)
hClose h
nukeFile $ f ++ "~" -- gpg dropping
+
+-- | Cleans apt's cache of downloaded packages to avoid using up disk
+-- space.
+cacheCleaned :: Property
+cacheCleaned = cmdProperty "apt-get" ["clean"]
+ `describe` "apt cache cleaned"