Standard apt configuration for stable now includes backports.
This commit is contained in:
parent
f806a55649
commit
2c1397c5b0
|
@ -22,7 +22,7 @@ getHostName :: Propellor HostName
|
||||||
getHostName = asks _hostname
|
getHostName = asks _hostname
|
||||||
|
|
||||||
os :: System -> AttrProperty
|
os :: System -> AttrProperty
|
||||||
os system = pureAttrProperty ("OS " ++ show system) $
|
os system = pureAttrProperty ("Operating " ++ show system) $
|
||||||
\d -> d { _os = Just system }
|
\d -> d { _os = Just system }
|
||||||
|
|
||||||
getOS :: Propellor (Maybe System)
|
getOS :: Propellor (Maybe System)
|
||||||
|
|
|
@ -24,9 +24,12 @@ showSuite Unstable = "unstable"
|
||||||
showSuite Experimental = "experimental"
|
showSuite Experimental = "experimental"
|
||||||
showSuite (DebianRelease r) = r
|
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 $
|
debLine suite mirror sections = unwords $
|
||||||
["deb", mirror, showSuite suite] ++ sections
|
["deb", mirror, suite] ++ sections
|
||||||
|
|
||||||
srcLine :: Line -> Line
|
srcLine :: Line -> Line
|
||||||
srcLine l = case words l of
|
srcLine l = case words l of
|
||||||
|
@ -37,9 +40,12 @@ stdSections :: [Section]
|
||||||
stdSections = ["main", "contrib", "non-free"]
|
stdSections = ["main", "contrib", "non-free"]
|
||||||
|
|
||||||
binandsrc :: String -> DebianSuite -> [Line]
|
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
|
where
|
||||||
l = debLine suite url stdSections
|
l = debLine (showSuite suite) url stdSections
|
||||||
|
bl = debLine (backportSuite suite) url stdSections
|
||||||
|
|
||||||
debCdn :: DebianSuite -> [Line]
|
debCdn :: DebianSuite -> [Line]
|
||||||
debCdn = binandsrc "http://cdn.debian.net/debian"
|
debCdn = binandsrc "http://cdn.debian.net/debian"
|
||||||
|
@ -62,7 +68,7 @@ securityUpdates suite
|
||||||
-- kernel.org.
|
-- kernel.org.
|
||||||
stdSourcesList :: DebianSuite -> Property
|
stdSourcesList :: DebianSuite -> Property
|
||||||
stdSourcesList suite = setSourcesList
|
stdSourcesList suite = setSourcesList
|
||||||
(debCdn suite ++ kernelOrg suite ++ securityUpdates suite)
|
(concatMap (\gen -> gen suite) [debCdn, kernelOrg, securityUpdates])
|
||||||
`describe` ("standard sources.list for " ++ show suite)
|
`describe` ("standard sources.list for " ++ show suite)
|
||||||
|
|
||||||
setSourcesList :: [Line] -> Property
|
setSourcesList :: [Line] -> Property
|
||||||
|
@ -96,6 +102,15 @@ installed' params ps = robustly $ check (isInstallable ps) go
|
||||||
where
|
where
|
||||||
go = runApt $ params ++ ["install"] ++ ps
|
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.
|
-- | Minimal install of package, without recommends.
|
||||||
installedMin :: [Package] -> Property
|
installedMin :: [Package] -> Property
|
||||||
installedMin = installed' ["--no-install-recommends", "-y"]
|
installedMin = installed' ["--no-install-recommends", "-y"]
|
||||||
|
|
|
@ -12,7 +12,7 @@ providerFor users baseurl = propertyList desc $
|
||||||
[ Apt.serviceInstalledRunning "apache2"
|
[ Apt.serviceInstalledRunning "apache2"
|
||||||
, Apt.installed ["simpleid"]
|
, Apt.installed ["simpleid"]
|
||||||
`onChange` Service.restarted "apache2"
|
`onChange` Service.restarted "apache2"
|
||||||
, File.fileProperty desc
|
, File.fileProperty (desc ++ " configured")
|
||||||
(map setbaseurl) "/etc/simpleid/config.inc"
|
(map setbaseurl) "/etc/simpleid/config.inc"
|
||||||
] ++ map identfile users
|
] ++ map identfile users
|
||||||
where
|
where
|
||||||
|
|
|
@ -6,6 +6,7 @@ propellor (0.3.1) UNRELEASED; urgency=medium
|
||||||
* Apache support.
|
* Apache support.
|
||||||
* Properties can now be satisfied differently on different operating
|
* Properties can now be satisfied differently on different operating
|
||||||
systems.
|
systems.
|
||||||
|
* Standard apt configuration for stable now includes backports.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Fri, 11 Apr 2014 15:00:11 -0400
|
-- Joey Hess <joeyh@debian.org> Fri, 11 Apr 2014 15:00:11 -0400
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue