diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-03-06 13:27:48 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-03-06 13:27:48 -0400 |
| commit | 27c5e59fba74601fc1852b80868d8672bc569197 (patch) | |
| tree | 67dcb82a45ade38c0319dc5b3d90e3b32dc445e0 | |
| parent | 19d7083ed8759d8b76420186f34e31fb46e869d8 (diff) | |
| parent | 7a8505608c45a49abff2dd4573a8e7579e0c366b (diff) | |
Merge branch 'joeyconfig'
| -rw-r--r-- | config-joey.hs | 2 | ||||
| -rw-r--r-- | debian/changelog | 3 | ||||
| -rw-r--r-- | src/Propellor/Property/File.hs | 6 | ||||
| -rw-r--r-- | src/Propellor/Property/Locale.hs | 5 | ||||
| -rw-r--r-- | src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 40 |
5 files changed, 49 insertions, 7 deletions
diff --git a/config-joey.hs b/config-joey.hs index 24eff835..12846d36 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -195,7 +195,7 @@ orca = standardSystem "orca.kitenet.net" Unstable "amd64" GitAnnexBuilder.standardAutoBuilder (System (Debian Unstable) "i386") Nothing (Cron.Times "30 * * * *") "2h") & Systemd.nspawned (GitAnnexBuilder.autoBuilderContainer - GitAnnexBuilder.standardAutoBuilder + GitAnnexBuilder.stackAutoBuilder (System (Debian (Stable "jessie")) "i386") (Just "ancient") (Cron.Times "45 * * * *") "2h") & Systemd.nspawned (GitAnnexBuilder.androidAutoBuilderContainer (Cron.Times "1 1 * * *") "3h") 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 <id@joeyh.name> 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 diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index 153d714f..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 @@ -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,12 +115,49 @@ 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 = propertyList "arm git-annex autobuilder" $ props |
