diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2017-07-30 18:57:30 -0700 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2017-08-01 15:33:48 -0400 |
| commit | 4500a4d8dc0a98754a59d994957d5ea87558c351 (patch) | |
| tree | c3001f24f0e18599ba40fb3f00cd80e3ce4fe51f /src | |
| parent | 012564beb0a14d16d23b78c1f278e75d8cdd91aa (diff) | |
add Sbuild.userConfig, at Joey's suggestion
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Sbuild.hs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs index 0b2ac211..f5116c04 100644 --- a/src/Propellor/Property/Sbuild.hs +++ b/src/Propellor/Property/Sbuild.hs @@ -78,6 +78,7 @@ module Propellor.Property.Sbuild ( keypairGenerated, keypairInsecurelyGenerated, usableBy, + userConfig, ) where import Propellor.Base @@ -445,6 +446,34 @@ ccachePrepared = propertyList "sbuild group ccache configured" $ props -- [Firewall.IPWithNumMask (IPv4 "127.0.0.1") 8]) -- `requires` installed -- sbuild group must exist +-- | Maintain recommended ~/.sbuildrc for a user, and adds them to the +-- sbuild group +-- +-- You probably want a custom ~/.sbuildrc on your workstation, but +-- this property is handy for quickly setting up build boxes. +userConfig :: User -> Property DebianLike +userConfig user@(User u) = go + `requires` usableBy + `requires` Apt.installed ["piuparts", "autopkgtest", "lintian"] + where + go = property' ("~/.sbuildrc for " ++ u) $ \w -> do + h <- liftIO (homedir user) + ensureProperty w $ File.hasContent (h </> ".sbuildrc") + [ "$run_lintian = 1;" + , "" + , "$run_piuparts = 1;" + , "$piuparts_opts = [" + , " '--no-eatmydata'," + , " '--schroot'," + , " '%r-%a-sbuild'," + , " '--fail-if-inadequate'," + , " ];" + , "" + , "$run_autopkgtest = 1;" + , "$autopkgtest_root_args = \"\";" + , "$autopkgtest_opts = [\"--\", \"schroot\", \"%r-%a-sbuild\"];" + ] + -- ==== utility functions ==== schrootFromSystem :: System -> Maybe SbuildSchroot |
