diff options
| author | Joey Hess <joey@kitenet.net> | 2014-04-13 15:54:25 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-04-13 15:54:25 -0400 |
| commit | 2c1397c5b09f2bbc8339c9763c60fcca601bc212 (patch) | |
| tree | 3a6ca05f64c276bbae69c6beaeacbc4311f7ca09 /Propellor/Property | |
| parent | f806a55649a5d06b479123e35fef4d592e6efe0d (diff) | |
Standard apt configuration for stable now includes backports.
Diffstat (limited to 'Propellor/Property')
| -rw-r--r-- | Propellor/Property/Apt.hs | 25 | ||||
| -rw-r--r-- | Propellor/Property/OpenId.hs | 2 |
2 files changed, 21 insertions, 6 deletions
diff --git a/Propellor/Property/Apt.hs b/Propellor/Property/Apt.hs index 4da13a2f..b7c281ce 100644 --- a/Propellor/Property/Apt.hs +++ b/Propellor/Property/Apt.hs @@ -24,9 +24,12 @@ showSuite Unstable = "unstable" showSuite Experimental = "experimental" showSuite (DebianRelease r) = r -debLine :: DebianSuite -> Url -> [Section] -> Line +backportSuite :: DebianSuite -> String +backportSuite suite = showSuite suite ++ "-backports" + +debLine :: String -> Url -> [Section] -> Line debLine suite mirror sections = unwords $ - ["deb", mirror, showSuite suite] ++ sections + ["deb", mirror, suite] ++ sections srcLine :: Line -> Line srcLine l = case words l of @@ -37,9 +40,12 @@ stdSections :: [Section] stdSections = ["main", "contrib", "non-free"] binandsrc :: String -> DebianSuite -> [Line] -binandsrc url suite = [l, srcLine l] +binandsrc url suite + | suite == Stable = [l, srcLine l, bl, srcLine bl] + | otherwise = [l, srcLine l] where - l = debLine suite url stdSections + l = debLine (showSuite suite) url stdSections + bl = debLine (backportSuite suite) url stdSections debCdn :: DebianSuite -> [Line] debCdn = binandsrc "http://cdn.debian.net/debian" @@ -62,7 +68,7 @@ securityUpdates suite -- kernel.org. stdSourcesList :: DebianSuite -> Property stdSourcesList suite = setSourcesList - (debCdn suite ++ kernelOrg suite ++ securityUpdates suite) + (concatMap (\gen -> gen suite) [debCdn, kernelOrg, securityUpdates]) `describe` ("standard sources.list for " ++ show suite) setSourcesList :: [Line] -> Property @@ -96,6 +102,15 @@ installed' params ps = robustly $ check (isInstallable ps) go where go = runApt $ params ++ ["install"] ++ ps +installedBackport :: [Package] -> Property +installedBackport ps = withOS desc $ \o -> case o of + (Just (System (Debian suite) _)) -> + ensureProperty $ installed' ["-t", backportSuite suite, "-y"] ps + Nothing -> error "cannot install backports; os not declared" + _ -> error $ "backports not supported on " ++ show o + where + desc = (unwords $ "apt installed backport":ps) + -- | Minimal install of package, without recommends. installedMin :: [Package] -> Property installedMin = installed' ["--no-install-recommends", "-y"] diff --git a/Propellor/Property/OpenId.hs b/Propellor/Property/OpenId.hs index 4c562175..051d6425 100644 --- a/Propellor/Property/OpenId.hs +++ b/Propellor/Property/OpenId.hs @@ -12,7 +12,7 @@ providerFor users baseurl = propertyList desc $ [ Apt.serviceInstalledRunning "apache2" , Apt.installed ["simpleid"] `onChange` Service.restarted "apache2" - , File.fileProperty desc + , File.fileProperty (desc ++ " configured") (map setbaseurl) "/etc/simpleid/config.inc" ] ++ map identfile users where |
