From d551752ac333b809b5e6174fabd0324f9b377f1b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 5 Mar 2016 16:02:14 -0400 Subject: propellor spin --- .../Property/SiteSpecific/GitAnnexBuilder.hs | 38 +++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index 153d714f..cde6b7d9 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -105,7 +105,6 @@ autoBuilderContainer :: (System -> Flavor -> Property HasInfo) -> System -> Flav autoBuilderContainer mkprop osver@(System _ arch) flavor crontime timeout = Systemd.container name osver (Chroot.debootstrapped mempty) & mkprop osver flavor - & buildDepsApt & autobuilder arch crontime timeout where name = arch ++ fromMaybe "" flavor ++ "-git-annex-builder" @@ -116,11 +115,48 @@ standardAutoBuilder :: System -> Flavor -> Property HasInfo standardAutoBuilder osver@(System _ arch) flavor = propertyList "standard git-annex autobuilder" $ props & os osver + & buildDepsApt + & Apt.stdSourcesList + & Apt.unattendedUpgrades + & Apt.cacheCleaned + & User.accountFor (User builduser) + & tree arch flavor + +stackAutoBuilder :: System -> Flavor -> Property HasInfo +stackAutoBuilder osver@(System _ arch) flavor = + propertyList "git-annex autobuilder using stack" $ props + & os osver + & buildDepsNoHaskellLibs & Apt.stdSourcesList & Apt.unattendedUpgrades & Apt.cacheCleaned & User.accountFor (User builduser) & tree arch flavor + & stackInstalled + +stackInstalled :: Property NoInfo +stackInstalled = withOS "stack installed" $ \o -> + case o of + (Just (System (Debian (Stable "jessie")) "i386")) -> + ensureProperty $ manualinstall "i386" + _ -> ensureProperty $ Apt.installed ["haskell-stack"] + where + -- Warning: Using a binary downloaded w/o validation. + manualinstall arch = check (not <$> doesFileExist binstack) $ + propertyList "stack installed from upstream tarball" + [ cmdProperty "wget" ["https://www.stackage.org/stack/linux-" ++ arch, "-O", tmptar] + `assume` MadeChange + , File.dirExists tmpdir + , cmdProperty "tar" ["xf", tmptar, "-C", tmpdir, "--strip-components=1"] + `assume` MadeChange + , cmdProperty "mv" [tmpdir "stack", binstack] + `assume` MadeChange + , cmdProperty "rm" ["-rf", tmpdir, tmptar] + `assume` MadeChange + ] + binstack = "/usr/bin/stack" + tmptar = "/root/stack.tar.gz" + tmpdir = "/root/stack" armAutoBuilder :: System -> Flavor -> Property HasInfo armAutoBuilder osver flavor = -- cgit v1.2.3 From 96190892e24d13db48eb76f9c20e0c076262a638 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 5 Mar 2016 17:25:51 -0400 Subject: add libmagic --- src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index cde6b7d9..2932baf7 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -80,7 +80,7 @@ buildDepsNoHaskellLibs = Apt.installed "liblockfile-simple-perl", "cabal-install", "vim", "less", -- needed by haskell libs "libxml2-dev", "libidn11-dev", "libgsasl7-dev", "libgnutls28-dev", - "alex", "happy", "c2hs" + "libmagic-dev", "alex", "happy", "c2hs" ] haskellPkgsInstalled :: String -> Property NoInfo -- cgit v1.2.3 From 7a8505608c45a49abff2dd4573a8e7579e0c366b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Mar 2016 13:27:42 -0400 Subject: Locale.available: Run locale-gen, instead of dpkg-reconfigure locales, which modified the locale.gen file and sometimes caused the property to need to make changes every time. --- debian/changelog | 3 +++ src/Propellor/Property/File.hs | 6 +++++- src/Propellor/Property/Locale.hs | 5 ++--- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/Propellor') diff --git a/debian/changelog b/debian/changelog index 3145acec..1b4c3998 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,9 @@ propellor (2.17.0) UNRELEASED; urgency=medium Thanks, Félix Sipma. * Firewall: add TCPFlag, Frequency, TCPSyn, ICMPTypeMatch Thanks, Félix Sipma. + * Locale.available: Run locale-gen, instead of dpkg-reconfigure locales, + which modified the locale.gen file and sometimes caused the property to + need to make changes every time. -- Joey Hess Mon, 29 Feb 2016 17:58:08 -0400 diff --git a/src/Propellor/Property/File.hs b/src/Propellor/Property/File.hs index 3021617c..e3732c9f 100644 --- a/src/Propellor/Property/File.hs +++ b/src/Propellor/Property/File.hs @@ -92,7 +92,11 @@ fileProperty' writer desc a f = property desc $ go =<< liftIO (doesFileExist f) let new = unlines (a (lines old)) if old == new then noChange - else makeChange $ updatefile new `viaStableTmp` f + else makeChange $ do + writeFile "/tmp/a" old + writeFile "/tmp/b" new + print ("MAKE CHANGE", f) + updatefile new `viaStableTmp` f go False = makeChange $ writer f (unlines $ a []) -- Replicate the original file's owner and mode. diff --git a/src/Propellor/Property/Locale.hs b/src/Propellor/Property/Locale.hs index a9fb3514..06cd63ad 100644 --- a/src/Propellor/Property/Locale.hs +++ b/src/Propellor/Property/Locale.hs @@ -57,7 +57,7 @@ available locale = (ensureAvailable ensureUnavailable) if locale `presentIn` locales then ensureProperty $ fileProperty desc (foldr uncomment []) f - `onChange` regenerate + `onChange` regenerate else return FailedChange -- locale unavailable for generation ensureUnavailable = fileProperty (locale ++ " locale not generated") (foldr comment []) f @@ -75,6 +75,5 @@ available locale = (ensureAvailable ensureUnavailable) l `presentIn` ls = any (l `isPrefix`) ls l `isPrefix` x = (l `isPrefixOf` x) || (("# " ++ l) `isPrefixOf` x) - regenerate = cmdProperty "dpkg-reconfigure" - ["-f", "noninteractive", "locales"] + regenerate = cmdProperty "locale-gen" [] `assume` MadeChange -- cgit v1.2.3