diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2016-05-17 11:30:51 -0700 |
|---|---|---|
| committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-05-17 11:30:51 -0700 |
| commit | 4a53c94f58b160bc05d3d9c034b9e187f4323ecd (patch) | |
| tree | 15ac44275ca825251ac3ef98d47225459e0e9462 /src | |
| parent | 0d8ad9f5bcf96fc713dc9029307169ce1473cd55 (diff) | |
new props and docstrings
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Sbuild.hs | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs index d2a55b7b..8c538fa0 100644 --- a/src/Propellor/Property/Sbuild.hs +++ b/src/Propellor/Property/Sbuild.hs @@ -5,8 +5,8 @@ Build and maintain schroots for use with sbuild. Suggested usage in @config.hs@: -> & Sbuild.built ((Debian Unstable) "i386") -> & Sbuild.updated ((Debian Unstable) "i386") `period` Weekly +> & Sbuild.builtFor ((Debian Unstable) "i386") +> & Sbuild.updatedFor ((Debian Unstable) "i386") `period` Weekly > & Sbuild.usableBy (User "spwhitton") > & Sbuild.shareAptCache > & Schroot.overlaysInTmpfs @@ -56,7 +56,31 @@ import qualified Propellor.Property.File as File import System.Directory +-- | An sbuild schroot, such as would be listed by @schroot -l@ +-- +-- Parts of the sbuild toolchain cannot distinguish between schroots with both +-- the same suite and the same architecture, so neither do we. +data SbuildSchroot = SbuildSchroot Suite Architecture + +-- | Build and configure a schroot for use with sbuild using a distribution's +-- standard mirror +-- +-- This function is a convenience wrapper around 'Sbuild.builtFor', allowing the +-- user to identify the schroot and distribution using the 'System' type +builtFor :: System -> Property DebianLike + -- | Build and configure a schroot for use with sbuild +built :: SbuildSchroot -> Apt.Url -> Property DebianLike + +-- | Ensure that an sbuild schroot's packages and apt indexes are updated +-- +-- This function is a convenience wrapper around 'Sbuild.updated', allowing the +-- user to identify the schroot using the 'System' type +updatedFor :: System -> Property DebianLike + +-- | Ensure that an sbuild schroot's packages and apt indexes are updated +updated :: SbuildSchroot -> Property DebianLike + built :: System -> Property DebianLike built system@(System _ arch) = case extractSuite system of Just s -> check (not <$> doesDirectoryExist (schrootLoc s arch)) (built' system) |
