diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2016-05-19 15:05:10 +0900 |
|---|---|---|
| committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-05-19 15:05:10 +0900 |
| commit | 5856c13d338ada5354721b4141e788b7961ffacf (patch) | |
| tree | 4463f947128ecab7a7b3fcb28915e1b47c16baae /src | |
| parent | 530d9f1b2bb1d740a4ca7404f0e885c64626a0e0 (diff) | |
Sbuild.ccachePrepared
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Sbuild.hs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs index 41f26f27..1d009f41 100644 --- a/src/Propellor/Property/Sbuild.hs +++ b/src/Propellor/Property/Sbuild.hs @@ -57,6 +57,7 @@ module Propellor.Property.Sbuild ( import Propellor.Base import Debootstrap (extractSuite) import qualified Propellor.Property.Apt as Apt +import qualified Propellor.Property.Ccache as Ccache import qualified Propellor.Property.File as File import qualified Propellor.Property.Firewall as Firewall @@ -85,6 +86,7 @@ built :: SbuildSchroot -> Apt.Url -> Property DebianLike built s@(SbuildSchroot suite arch) mirror = check (not <$> doesDirectoryExist (schrootRoot s)) $ property ("built schroot for " ++ show s) go `requires` keypairGenerated + `requires` ccachePrepared `requires` installed where go :: Property DebianLike @@ -182,6 +184,22 @@ keypairGenerated = check (not <$> doesFileExist secKeyFile) $ go `assume` MadeChange secKeyFile = "/var/lib/sbuild/apt-keys/sbuild-key.sec" +ccachePrepared :: Property DebianLike +ccachePrepared = propertyList "sbuild group ccache configured" $ props + & (Group "sbuild") `Ccache.hasGroupCache` "2G" + & "/etc/schroot/sbuild/fstab" `File.containsLine` + "/var/cache/ccache-sbuild /var/cache/ccache-sbuild rw,bind 0 0" + & "/var/cache/ccache-sbuild/sbuild-setup" `File.hasContent` + [ "#!/bin/sh" + , "export CCACHE_DIR=/var/cache/ccache-sbuild" + , "export CCACHE_UMASK=002" + , "export CCACHE_COMPRESS=1" + , "unset CCACHE_HARDLINK" + , "export PATH=\"/usr/lib/ccache:$PATH\"" + , "" + , "exec \"$@\"" + ] + -- | Block network access during builds -- -- This is a hack from <https://wiki.debian.org/sbuild> until #802850 and |
