From 4ac314fb4812ccdb62e930fe53e312ced6171e12 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 5 Jun 2014 17:01:32 -0400 Subject: Apt.stdSourcesList no longer needs a suite to be specified. --- src/Propellor/Property/Apt.hs | 13 ++++++++++--- src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 8 ++++---- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs index 69144d72..17057af2 100644 --- a/src/Propellor/Property/Apt.hs +++ b/src/Propellor/Property/Apt.hs @@ -64,12 +64,19 @@ securityUpdates suite | otherwise = [] -- | Makes sources.list have a standard content using the mirror CDN, --- with a particular DebianSuite. +-- with the Debian suite configured by the os. -- -- Since the CDN is sometimes unreliable, also adds backup lines using -- kernel.org. -stdSourcesList :: DebianSuite -> Property -stdSourcesList suite = stdSourcesList' suite [] +stdSourcesList :: Property +stdSourcesList = withOS ("standard sources.list") $ \o -> + case o of + (Just (System (Debian suite) _)) -> + ensureProperty $ stdSourcesListFor suite + _ -> error "os is not declared to be Debian" + +stdSourcesListFor :: DebianSuite -> Property +stdSourcesListFor suite = stdSourcesList' suite [] -- | Adds additional sources.list generators. -- diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index 6e4ca81a..57a6b084 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -100,7 +100,7 @@ standardAutoBuilderContainer :: (System -> Docker.Image) -> Architecture -> Int standardAutoBuilderContainer dockerImage arch buildminute timeout = Docker.container (arch ++ "-git-annex-builder") (dockerImage $ System (Debian Unstable) arch) & os (System (Debian Unstable) arch) - & Apt.stdSourcesList Unstable + & Apt.stdSourcesList & Apt.installed ["systemd"] & Apt.unattendedUpgrades & buildDepsApt @@ -118,7 +118,7 @@ androidContainer :: (System -> Docker.Image) -> Docker.ContainerName -> Property androidContainer dockerImage name setupgitannexdir gitannexdir = Docker.container name (dockerImage $ System (Debian Stable) "i386") & os (System (Debian Stable) "i386") - & Apt.stdSourcesList Stable + & Apt.stdSourcesList & Apt.installed ["systemd"] & User.accountFor builduser & File.dirExists gitbuilderdir @@ -145,7 +145,7 @@ armelCompanionContainer :: (System -> Docker.Image) -> Host armelCompanionContainer dockerImage = Docker.container "armel-git-annex-builder-companion" (dockerImage $ System (Debian Unstable) "amd64") & os (System (Debian Unstable) "amd64") - & Apt.stdSourcesList Unstable + & Apt.stdSourcesList & Apt.installed ["systemd"] & Apt.unattendedUpgrades -- This volume is shared with the armel builder. @@ -163,7 +163,7 @@ armelAutoBuilderContainer :: (System -> Docker.Image) -> Cron.CronTimes -> TimeO armelAutoBuilderContainer dockerImage crontimes timeout = Docker.container "armel-git-annex-builder" (dockerImage $ System (Debian Unstable) "armel") & os (System (Debian Unstable) "armel") - & Apt.stdSourcesList Unstable + & Apt.stdSourcesList & Apt.unattendedUpgrades & Apt.installed ["systemd"] & Apt.installed ["openssh-client"] -- cgit v1.3-2-g0d8e From 0f4e219838a8101471715de94e98a1279f4879a6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 5 Jun 2014 17:07:02 -0400 Subject: can now derive Show for Attr --- src/Propellor/Types/Attr.hs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src') diff --git a/src/Propellor/Types/Attr.hs b/src/Propellor/Types/Attr.hs index e8c22a94..4389a4e5 100644 --- a/src/Propellor/Types/Attr.hs +++ b/src/Propellor/Types/Attr.hs @@ -14,7 +14,7 @@ data Attr = Attr , _namedconf :: Dns.NamedConfMap , _dockerattr :: DockerAttr } - deriving (Eq) + deriving (Eq, Show) instance Monoid Attr where mempty = Attr mempty mempty mempty mempty mempty @@ -26,15 +26,6 @@ instance Monoid Attr where , _dockerattr = _dockerattr old <> _dockerattr new } -instance Show Attr where - show a = unlines - [ "OS " ++ show (_os a) - , "sshPubKey " ++ show (_sshPubKey a) - , "dns " ++ show (_dns a) - , "namedconf " ++ show (_namedconf a) - , show (_dockerattr a) - ] - data Val a = Val a | NoVal deriving (Eq, Show) -- cgit v1.3-2-g0d8e From 16ae2b503f109abbdd0cb1fca4065ec26b181d49 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 5 Jun 2014 17:10:16 -0400 Subject: display improvements --- src/Propellor/Types.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs index d0481b69..d91ce71b 100644 --- a/src/Propellor/Types.hs +++ b/src/Propellor/Types.hs @@ -66,7 +66,7 @@ data Property = Property } instance Show Property where - show = propertyDesc + show p = "property " ++ show (propertyDesc p) -- | A property that can be reverted. data RevertableProperty = RevertableProperty Property Property -- cgit v1.3-2-g0d8e