From adc04e1f33619d8a2f23cf6bbc1c9bced42066ee Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 1 May 2016 17:53:45 -0400 Subject: add news item for propellor 3.0.3 --- doc/news/version_3.0.2.mdwn | 10 ---------- doc/news/version_3.0.3.mdwn | 6 ++++++ 2 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 doc/news/version_3.0.2.mdwn create mode 100644 doc/news/version_3.0.3.mdwn diff --git a/doc/news/version_3.0.2.mdwn b/doc/news/version_3.0.2.mdwn deleted file mode 100644 index 4a36d250..00000000 --- a/doc/news/version_3.0.2.mdwn +++ /dev/null @@ -1,10 +0,0 @@ -propellor 3.0.2 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * Added Apt.periodicUpdates. - Thanks, Félix Sipma. - * Apt.unattendedUpgrades: Enable mailing problem reports to root. - Thanks, Félix Sipma. - * Added Propellor.Property.Fstab, and moved the fstabbed property to there. - * Attic module added for the backup system. - Thanks, Félix Sipma. - * Fix build with directory-1.2.6.2."""]] \ No newline at end of file diff --git a/doc/news/version_3.0.3.mdwn b/doc/news/version_3.0.3.mdwn new file mode 100644 index 00000000..75ea3c33 --- /dev/null +++ b/doc/news/version_3.0.3.mdwn @@ -0,0 +1,6 @@ +propellor 3.0.3 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Remove Propellor.DotDir from the propellor library, as its use of + Paths\_propellor prevents use of the module out of propellor's tree. + This module is only needed for the wrapper program anyway, which + handles --init."""]] \ No newline at end of file -- cgit v1.2.3 From 57441356ebc64c020133737392b4d40de816dc99 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Mon, 2 May 2016 00:10:57 +0000 Subject: file bug --- doc/todo/propellor_--init_option_B_failure.mdwn | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 doc/todo/propellor_--init_option_B_failure.mdwn diff --git a/doc/todo/propellor_--init_option_B_failure.mdwn b/doc/todo/propellor_--init_option_B_failure.mdwn new file mode 100644 index 00000000..dc6ecff7 --- /dev/null +++ b/doc/todo/propellor_--init_option_B_failure.mdwn @@ -0,0 +1,35 @@ +With any of the released 3.0.* versions: + + artemis ~ % propellor --init + + + _ ______`| ,-.__ + .--------------------------- / \___-=O`/|O`/__| (____.' + - Welcome to -- \ / | / ) _.-'-._ + - Propellor! -- `/-==__ _/__|/__=-| ( \_ + `--------------------------- * \ | | '--------' + (o) ` + + + Propellor's configuration file is ~/.propellor/config.hs + + Let's get you started with a simple config that you can adapt + to your needs. You can start with: + A: A clone of propellor's git repository (most flexible) + B: The bare minimum files to use propellor (most simple) + Which would you prefer? [A|B] B + Initialized empty Git repository in /home/swhitton/.propellor/.git/ + Creating minimal config ... done + + ------------------------------------------------------------------------------ + + Let's try building the propellor configuration, to make sure it will work... + + Writing a default package environment file to + /home/swhitton/.propellor/cabal.sandbox.config + Creating a new sandbox at /home/swhitton/.propellor/.cabal-sandbox + Resolving dependencies... + Configuring config-0... + cabal: At least the following dependencies are missing: + propellor >=3.0 + propellor: failed to make dist/setup-config -- cgit v1.2.3 From 582a99bbffd59dafb1a91650882e0074d56d242b Mon Sep 17 00:00:00 2001 From: spwhitton Date: Mon, 2 May 2016 00:11:28 +0000 Subject: note installation method --- doc/todo/propellor_--init_option_B_failure.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/todo/propellor_--init_option_B_failure.mdwn b/doc/todo/propellor_--init_option_B_failure.mdwn index dc6ecff7..96891bf8 100644 --- a/doc/todo/propellor_--init_option_B_failure.mdwn +++ b/doc/todo/propellor_--init_option_B_failure.mdwn @@ -33,3 +33,5 @@ With any of the released 3.0.* versions: cabal: At least the following dependencies are missing: propellor >=3.0 propellor: failed to make dist/setup-config + +(propellor installed from Debian) -- cgit v1.2.3 From bc9f2271e3c0cf275c99bbf1e6b4defaab284026 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Mon, 2 May 2016 00:12:10 +0000 Subject: narrow versions --- doc/todo/propellor_--init_option_B_failure.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/todo/propellor_--init_option_B_failure.mdwn b/doc/todo/propellor_--init_option_B_failure.mdwn index 96891bf8..f1998204 100644 --- a/doc/todo/propellor_--init_option_B_failure.mdwn +++ b/doc/todo/propellor_--init_option_B_failure.mdwn @@ -1,4 +1,4 @@ -With any of the released 3.0.* versions: +With 3.0.1, 3.0.2 or 3.0.3: artemis ~ % propellor --init -- cgit v1.2.3 From 0694b1b0e458b467f0860b6f33b6b28e26befcfc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 2 May 2016 08:08:40 -0400 Subject: comment --- .../comment_1_f2229a499f4be0e64d030e2ecc0927f6._comment | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/todo/propellor_--init_option_B_failure/comment_1_f2229a499f4be0e64d030e2ecc0927f6._comment diff --git a/doc/todo/propellor_--init_option_B_failure/comment_1_f2229a499f4be0e64d030e2ecc0927f6._comment b/doc/todo/propellor_--init_option_B_failure/comment_1_f2229a499f4be0e64d030e2ecc0927f6._comment new file mode 100644 index 00000000..2b569afb --- /dev/null +++ b/doc/todo/propellor_--init_option_B_failure/comment_1_f2229a499f4be0e64d030e2ecc0927f6._comment @@ -0,0 +1,16 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-05-02T12:03:24Z" + content=""" +You need to update the Debian package to include the propellor +haskell library in binary form. I had not included the haskell library in +the package before in binary form, because I was targeting only option A, +where it's cloned from the git archive in the package. + +Any other installation method than the debian package that I know of +installs both the propellor command and the propellor haskell library. + +(Note that propellor 3.0.1 fixes an unrelated bug that prevented option B +from working.) +"""]] -- cgit v1.2.3 From 97cfa21427e5186e40afdf57556a8ee6b13ee970 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 2 May 2016 09:57:04 -0400 Subject: setting up joeyconfig after merge --- config.hs | 2 +- privdata/relocate | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 privdata/relocate diff --git a/config.hs b/config.hs index ec313725..97d90636 120000 --- a/config.hs +++ b/config.hs @@ -1 +1 @@ -config-simple.hs \ No newline at end of file +joeyconfig.hs \ No newline at end of file diff --git a/privdata/relocate b/privdata/relocate new file mode 100644 index 00000000..271692d8 --- /dev/null +++ b/privdata/relocate @@ -0,0 +1 @@ +.joeyconfig -- cgit v1.2.3 From fffa495d9170ef988131c2d3609221b8ba67c2a3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 2 May 2016 09:57:53 -0400 Subject: correction --- .../comment_1_f2229a499f4be0e64d030e2ecc0927f6._comment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/todo/propellor_--init_option_B_failure/comment_1_f2229a499f4be0e64d030e2ecc0927f6._comment b/doc/todo/propellor_--init_option_B_failure/comment_1_f2229a499f4be0e64d030e2ecc0927f6._comment index 2b569afb..e9edb435 100644 --- a/doc/todo/propellor_--init_option_B_failure/comment_1_f2229a499f4be0e64d030e2ecc0927f6._comment +++ b/doc/todo/propellor_--init_option_B_failure/comment_1_f2229a499f4be0e64d030e2ecc0927f6._comment @@ -11,6 +11,6 @@ where it's cloned from the git archive in the package. Any other installation method than the debian package that I know of installs both the propellor command and the propellor haskell library. -(Note that propellor 3.0.1 fixes an unrelated bug that prevented option B +(Note that propellor 3.0.1^W3.0.3 fixes an unrelated bug that prevented option B from working.) """]] -- cgit v1.2.3 From 6f3a19973ef03c80d634d2cb64d2a72af4fb3548 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 2 May 2016 09:57:53 -0400 Subject: clean up after merge --- config.hs | 2 +- privdata/relocate | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 privdata/relocate diff --git a/config.hs b/config.hs index 97d90636..ec313725 120000 --- a/config.hs +++ b/config.hs @@ -1 +1 @@ -joeyconfig.hs \ No newline at end of file +config-simple.hs \ No newline at end of file diff --git a/privdata/relocate b/privdata/relocate deleted file mode 100644 index 271692d8..00000000 --- a/privdata/relocate +++ /dev/null @@ -1 +0,0 @@ -.joeyconfig -- cgit v1.2.3 From 169fac74554aeaf5227e434d33eb706dcf04639b Mon Sep 17 00:00:00 2001 From: spwhitton Date: Tue, 3 May 2016 15:07:37 +0000 Subject: bug ownership --- doc/todo/propellor_--init_option_B_failure.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/todo/propellor_--init_option_B_failure.mdwn b/doc/todo/propellor_--init_option_B_failure.mdwn index f1998204..f5cd964c 100644 --- a/doc/todo/propellor_--init_option_B_failure.mdwn +++ b/doc/todo/propellor_--init_option_B_failure.mdwn @@ -1,3 +1,5 @@ +[[!tag user/spwhitton]] + With 3.0.1, 3.0.2 or 3.0.3: artemis ~ % propellor --init -- cgit v1.2.3 From 1e12a3a8c4fd0a5b027ff7923bb014b7836f8fd9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 5 May 2016 10:37:57 -0400 Subject: Run letsencrypt with --noninteractive. --- debian/changelog | 6 ++++++ src/Propellor/Property/LetsEncrypt.hs | 1 + 2 files changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6f6f2884..fcad255e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +propellor (3.0.4) UNRELEASED; urgency=medium + + * Run letsencrypt with --noninteractive. + + -- Joey Hess Thu, 05 May 2016 10:37:43 -0400 + propellor (3.0.3) unstable; urgency=medium * Remove Propellor.DotDir from the propellor library, as its use of diff --git a/src/Propellor/Property/LetsEncrypt.hs b/src/Propellor/Property/LetsEncrypt.hs index bf38046b..88d4f5a8 100644 --- a/src/Propellor/Property/LetsEncrypt.hs +++ b/src/Propellor/Property/LetsEncrypt.hs @@ -74,6 +74,7 @@ letsEncrypt' (AgreeTOS memail) domain domains webroot = , "--webroot" , "--webroot-path", webroot , "--text" + , "--noninteractive" , "--keep-until-expiring" ] ++ map (\d -> "--domain="++d) alldomains -- cgit v1.2.3 From 0414ecb529b4b73547bfd753ce5b810cfe0f59d0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 5 May 2016 10:38:01 -0400 Subject: setting up joeyconfig after merge --- config.hs | 2 +- privdata/relocate | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 privdata/relocate diff --git a/config.hs b/config.hs index ec313725..97d90636 120000 --- a/config.hs +++ b/config.hs @@ -1 +1 @@ -config-simple.hs \ No newline at end of file +joeyconfig.hs \ No newline at end of file diff --git a/privdata/relocate b/privdata/relocate new file mode 100644 index 00000000..271692d8 --- /dev/null +++ b/privdata/relocate @@ -0,0 +1 @@ +.joeyconfig -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 From 5cb6ddd9a9dc73bb514ebfdd86b0026e7ad97770 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 5 May 2016 15:44:05 -0400 Subject: workaround --- src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index ce89b94a..b4812c7e 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -135,6 +135,8 @@ stackAutoBuilder suite arch flavor = & User.accountFor (User builduser) & tree arch flavor & stackInstalled + -- Workaround https://github.com/commercialhaskell/stack/issues/2093 + & Apt.installed ["libtinfo-dev"] stackInstalled :: Property Linux stackInstalled = withOS "stack installed" $ \w o -> -- cgit v1.2.3 From f815316301ef176c980deed3a89ab58e6a18efff Mon Sep 17 00:00:00 2001 From: davean Date: Fri, 6 May 2016 21:17:08 -0400 Subject: Compiling propellor on GHC 8.0.1-rc4 ConstrainedClassMethods was added in GHC 7.6.1.3 so I think its sufficiently backwards compatible for you? --- src/Propellor/Base.hs | 2 +- src/Propellor/Types/ZFS.hs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Propellor/Base.hs b/src/Propellor/Base.hs index 2a0f5cbc..ef75bf03 100644 --- a/src/Propellor/Base.hs +++ b/src/Propellor/Base.hs @@ -47,7 +47,7 @@ import Propellor.PropAccum import Propellor.Location import Propellor.Utilities -import System.Directory +import System.Directory hiding (isSymbolicLink) import System.IO import System.FilePath import Data.Maybe diff --git a/src/Propellor/Types/ZFS.hs b/src/Propellor/Types/ZFS.hs index 8784c641..3ce4b22c 100644 --- a/src/Propellor/Types/ZFS.hs +++ b/src/Propellor/Types/ZFS.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE ConstrainedClassMethods #-} -- | Types for ZFS Properties. -- -- Copyright 2016 Evan Cofsky -- cgit v1.2.3 From 2ec29c2f6c9ea149411d360f01147f4935910705 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 May 2016 00:27:05 -0400 Subject: changelog --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index fcad255e..43931aae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ propellor (3.0.4) UNRELEASED; urgency=medium * Run letsencrypt with --noninteractive. + * Fix build with ghc 8.0.1-rc4. + Thanks, davean. -- Joey Hess Thu, 05 May 2016 10:37:43 -0400 -- cgit v1.2.3 From 87e62ea079c507bf55437c5489dbeae7efc918a4 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sat, 7 May 2016 23:06:05 +0000 Subject: bug fix upload is pending --- doc/todo/propellor_--init_option_B_failure.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/todo/propellor_--init_option_B_failure.mdwn b/doc/todo/propellor_--init_option_B_failure.mdwn index f5cd964c..f706cba6 100644 --- a/doc/todo/propellor_--init_option_B_failure.mdwn +++ b/doc/todo/propellor_--init_option_B_failure.mdwn @@ -37,3 +37,5 @@ With 3.0.1, 3.0.2 or 3.0.3: propellor: failed to make dist/setup-config (propellor installed from Debian) + +: This is in the NEW queue. [[done]] --spwhitton -- cgit v1.2.3 From b8667a86aa66c829f52dba16e692901987ef0f59 Mon Sep 17 00:00:00 2001 From: jelmer Date: Mon, 9 May 2016 00:10:07 +0000 Subject: --- doc/forum/recent_propellor_snapshots_cause_ghc_OOMs.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 doc/forum/recent_propellor_snapshots_cause_ghc_OOMs.mdwn diff --git a/doc/forum/recent_propellor_snapshots_cause_ghc_OOMs.mdwn b/doc/forum/recent_propellor_snapshots_cause_ghc_OOMs.mdwn new file mode 100644 index 00000000..3dc6c7c8 --- /dev/null +++ b/doc/forum/recent_propellor_snapshots_cause_ghc_OOMs.mdwn @@ -0,0 +1,6 @@ +With recent snapshots of propellor (after at least March 11) I am seeing significant increases of memory consumed by ghc when compiling propellor. Previous versions would compile and run on e.g. a raspberry pi. With a recent snapshot, I am seeing ghc OOM with a 5GB ulimit on my desktop. Has anybody else seen this? + +This is with the same version of GHC. + + % ghc --version + The Glorious Glasgow Haskell Compilation System, version 7.10.3 -- cgit v1.2.3 From dcc67d24fcc50006de111a83a0d5db75180ffaa4 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Tue, 10 May 2016 00:47:11 +0000 Subject: post question --- doc/todo/License_in_propellor.cabal.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/todo/License_in_propellor.cabal.mdwn diff --git a/doc/todo/License_in_propellor.cabal.mdwn b/doc/todo/License_in_propellor.cabal.mdwn new file mode 100644 index 00000000..7e724c5a --- /dev/null +++ b/doc/todo/License_in_propellor.cabal.mdwn @@ -0,0 +1 @@ +`propellor.cabal` claims that propellor is licensed under the 3-clause BSD license. `debian/copyright` says it's licensed under the 2-clause BSD license. Which is correct? An ftp-master noticed. Thanks. --spwhitton -- cgit v1.2.3 From fc75b2b9ab929f921512dafe69465106f497ad20 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 10 May 2016 12:05:45 -0400 Subject: correct license --- propellor.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/propellor.cabal b/propellor.cabal index e931e3df..806950b9 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -1,7 +1,7 @@ Name: propellor Version: 3.0.3 Cabal-Version: >= 1.8 -License: BSD3 +License: BSD2 Maintainer: Joey Hess Author: Joey Hess Stability: Stable -- cgit v1.2.3 From e4d412261c56696ab680bf607e3b7ca6182a0757 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 10 May 2016 12:07:12 -0400 Subject: followup --- doc/todo/License_in_propellor.cabal.mdwn | 2 ++ .../comment_1_3009093e2ab7bcf9e60555da71796a63._comment | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 doc/todo/License_in_propellor.cabal/comment_1_3009093e2ab7bcf9e60555da71796a63._comment diff --git a/doc/todo/License_in_propellor.cabal.mdwn b/doc/todo/License_in_propellor.cabal.mdwn index 7e724c5a..90a0e8f8 100644 --- a/doc/todo/License_in_propellor.cabal.mdwn +++ b/doc/todo/License_in_propellor.cabal.mdwn @@ -1 +1,3 @@ `propellor.cabal` claims that propellor is licensed under the 3-clause BSD license. `debian/copyright` says it's licensed under the 2-clause BSD license. Which is correct? An ftp-master noticed. Thanks. --spwhitton + +> [[fixed|done]] --[[Joey]] diff --git a/doc/todo/License_in_propellor.cabal/comment_1_3009093e2ab7bcf9e60555da71796a63._comment b/doc/todo/License_in_propellor.cabal/comment_1_3009093e2ab7bcf9e60555da71796a63._comment new file mode 100644 index 00000000..3ea7af89 --- /dev/null +++ b/doc/todo/License_in_propellor.cabal/comment_1_3009093e2ab7bcf9e60555da71796a63._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-05-10T16:06:12Z" + content=""" +It's 2-clause, see LICENSE. + +Cabal file license fields are too restricted syntax to be more than +a general indication of license in general I think. +"""]] -- cgit v1.2.3 From 7cc4dbb7bcf13a57cbda9c65dea4b49722dd6806 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 10 May 2016 12:07:18 -0400 Subject: clean up after merge --- config.hs | 2 +- privdata/relocate | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 privdata/relocate diff --git a/config.hs b/config.hs index 97d90636..ec313725 120000 --- a/config.hs +++ b/config.hs @@ -1 +1 @@ -joeyconfig.hs \ No newline at end of file +config-simple.hs \ No newline at end of file diff --git a/privdata/relocate b/privdata/relocate deleted file mode 100644 index 271692d8..00000000 --- a/privdata/relocate +++ /dev/null @@ -1 +0,0 @@ -.joeyconfig -- cgit v1.2.3 From 9a62bc7609794221a4b43ce52e6b15dd5122804b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 10 May 2016 12:09:28 -0400 Subject: comment --- .../comment_1_0e46ad1844c37a65c532cafe81fd883a._comment | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/forum/recent_propellor_snapshots_cause_ghc_OOMs/comment_1_0e46ad1844c37a65c532cafe81fd883a._comment diff --git a/doc/forum/recent_propellor_snapshots_cause_ghc_OOMs/comment_1_0e46ad1844c37a65c532cafe81fd883a._comment b/doc/forum/recent_propellor_snapshots_cause_ghc_OOMs/comment_1_0e46ad1844c37a65c532cafe81fd883a._comment new file mode 100644 index 00000000..be42b0df --- /dev/null +++ b/doc/forum/recent_propellor_snapshots_cause_ghc_OOMs/comment_1_0e46ad1844c37a65c532cafe81fd883a._comment @@ -0,0 +1,13 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-05-10T16:07:39Z" + content=""" +The enhanced property types in propellor 3.0 are known to have made ghc use +more memory when building it. Building with -O0 helped a lot for me, and +it's doing ok on a 500 mb memory machine. So I recommend -O0 in your cabal +file if you don't have that already. + +I wrote down my memory benchmarks here: + +"""]] -- cgit v1.2.3 From d8bf18dd9cb6bc9998f16251348d50e4826a78c6 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sat, 14 May 2016 01:37:11 +0000 Subject: Added a comment --- .../comment_3_3b1053891d1bd9c424f1b517a4686e5d._comment | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/todo/spin_without_remote_compilation/comment_3_3b1053891d1bd9c424f1b517a4686e5d._comment diff --git a/doc/todo/spin_without_remote_compilation/comment_3_3b1053891d1bd9c424f1b517a4686e5d._comment b/doc/todo/spin_without_remote_compilation/comment_3_3b1053891d1bd9c424f1b517a4686e5d._comment new file mode 100644 index 00000000..096d20aa --- /dev/null +++ b/doc/todo/spin_without_remote_compilation/comment_3_3b1053891d1bd9c424f1b517a4686e5d._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 3" + date="2016-05-14T01:37:11Z" + content=""" +This feature has become more poignant with propellor v3's increased memory requirements. +"""]] -- cgit v1.2.3 From 804cca53e04be3c7f905f4ebc24fe7a76c8941d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Sipma?= Date: Sun, 15 May 2016 11:23:31 +0200 Subject: add Borg module --- propellor.cabal | 1 + src/Propellor/Property/Borg.hs | 153 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 src/Propellor/Property/Borg.hs diff --git a/propellor.cabal b/propellor.cabal index 806950b9..beac5c38 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -81,6 +81,7 @@ Library Propellor.Property.Apt Propellor.Property.Apt.PPA Propellor.Property.Attic + Propellor.Property.Borg Propellor.Property.Cmd Propellor.Property.Concurrent Propellor.Property.Conductor diff --git a/src/Propellor/Property/Borg.hs b/src/Propellor/Property/Borg.hs new file mode 100644 index 00000000..e9abf2aa --- /dev/null +++ b/src/Propellor/Property/Borg.hs @@ -0,0 +1,153 @@ +-- | Maintainer: Félix Sipma + +module Propellor.Property.Borg + ( installed + , repoExists + , init + , restored + , backup + , KeepPolicy (..) + ) where + +import Propellor.Base hiding (init) +import Prelude hiding (init) +import qualified Propellor.Property.Apt as Apt +import qualified Propellor.Property.Cron as Cron +import Data.List (intercalate) + +type BorgParam = String + +type BorgRepo = FilePath + +installed :: Property DebianLike +installed = withOS desc $ \w o -> case o of + (Just (System (Debian (Stable "jessie")) _)) -> ensureProperty w $ + Apt.installedBackport ["borgbackup"] + _ -> ensureProperty w $ + Apt.installed ["borgbackup"] + where + desc = "installed borgbackup" + +repoExists :: BorgRepo -> IO Bool +repoExists repo = boolSystem "borg" [Param "list", File repo] + +-- | Inits a new borg repository +init :: BorgRepo -> Property DebianLike +init backupdir = check (not <$> repoExists backupdir) (cmdProperty "borg" initargs) + `requires` installed + where + initargs = + [ "init" + , backupdir + ] + +-- | Restores a directory from an borg backup. +-- +-- Only does anything if the directory does not exist, or exists, +-- but is completely empty. +-- +-- The restore is performed atomically; restoring to a temp directory +-- and then moving it to the directory. +restored :: FilePath -> BorgRepo -> Property DebianLike +restored dir backupdir = go `requires` installed + where + go :: Property DebianLike + go = property (dir ++ " restored by borg") $ ifM (liftIO needsRestore) + ( do + warningMessage $ dir ++ " is empty/missing; restoring from backup ..." + liftIO restore + , noChange + ) + + needsRestore = null <$> catchDefaultIO [] (dirContents dir) + + restore = withTmpDirIn (takeDirectory dir) "borg-restore" $ \tmpdir -> do + ok <- boolSystem "borg" $ + [ Param "extract" + , Param backupdir + , Param tmpdir + ] + let restoreddir = tmpdir ++ "/" ++ dir + ifM (pure ok <&&> doesDirectoryExist restoreddir) + ( do + void $ tryIO $ removeDirectory dir + renameDirectory restoreddir dir + return MadeChange + , return FailedChange + ) + +-- | Installs a cron job that causes a given directory to be backed +-- up, by running borg with some parameters. +-- +-- If the directory does not exist, or exists but is completely empty, +-- this Property will immediately restore it from an existing backup. +-- +-- So, this property can be used to deploy a directory of content +-- to a host, while also ensuring any changes made to it get backed up. +-- For example: +-- +-- > & Borg.backup "/srv/git" "root@myserver:/mnt/backup/git.borg" Cron.Daily +-- > ["--exclude=/srv/git/tobeignored"] +-- > [Borg.KeepDays 7, Borg.KeepWeeks 4, Borg.KeepMonths 6, Borg.KeepYears 1] +-- +-- Note that this property does not make borg encrypt the backup +-- repository. +-- +-- Since borg uses a fair amount of system resources, only one borg +-- backup job will be run at a time. Other jobs will wait their turns to +-- run. +backup :: FilePath -> BorgRepo -> Cron.Times -> [BorgParam] -> [KeepPolicy] -> Property DebianLike +backup dir backupdir crontimes extraargs kp = backup' dir backupdir crontimes extraargs kp + `requires` restored dir backupdir + +-- | Does a backup, but does not automatically restore. +backup' :: FilePath -> BorgRepo -> Cron.Times -> [BorgParam] -> [KeepPolicy] -> Property DebianLike +backup' dir backupdir crontimes extraargs kp = cronjob + `describe` desc + `requires` installed + where + desc = backupdir ++ " borg backup" + cronjob = Cron.niceJob ("borg_backup" ++ dir) crontimes (User "root") "/" $ + "flock " ++ shellEscape lockfile ++ " sh -c " ++ backupcmd + lockfile = "/var/lock/propellor-borg.lock" + backupcmd = intercalate ";" $ + createCommand + : if null kp then [] else [pruneCommand] + createCommand = unwords $ + [ "borg" + , "create" + , "--stats" + ] + ++ map shellEscape extraargs ++ + [ shellEscape backupdir ++ "::" ++ "$(date --iso-8601=ns --utc)" + , shellEscape dir + ] + pruneCommand = unwords $ + [ "borg" + , "prune" + , shellEscape backupdir + ] + ++ + map keepParam kp + +-- | Constructs an BorgParam that specifies which old backup generations to +-- keep. By default, all generations are kept. However, when this parameter is +-- passed to the `backup` property, they will run borg prune to clean out +-- generations not specified here. +keepParam :: KeepPolicy -> BorgParam +keepParam (KeepHours n) = "--keep-hourly=" ++ show n +keepParam (KeepDays n) = "--keep-daily=" ++ show n +keepParam (KeepWeeks n) = "--keep-daily=" ++ show n +keepParam (KeepMonths n) = "--keep-monthly=" ++ show n +keepParam (KeepYears n) = "--keep-yearly=" ++ show n + +-- | Policy for backup generations to keep. For example, KeepDays 30 will +-- keep the latest backup for each day when a backup was made, and keep the +-- last 30 such backups. When multiple KeepPolicies are combined together, +-- backups meeting any policy are kept. See borg's man page for details. +data KeepPolicy + = KeepHours Int + | KeepDays Int + | KeepWeeks Int + | KeepMonths Int + | KeepYears Int -- cgit v1.2.3 From f1f1a08cfffcfab7b2bf40a1d19b9c5062884194 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 May 2016 14:47:04 -0400 Subject: setting up joeyconfig after merge --- config.hs | 2 +- privdata/relocate | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 privdata/relocate diff --git a/config.hs b/config.hs index ec313725..97d90636 120000 --- a/config.hs +++ b/config.hs @@ -1 +1 @@ -config-simple.hs \ No newline at end of file +joeyconfig.hs \ No newline at end of file diff --git a/privdata/relocate b/privdata/relocate new file mode 100644 index 00000000..271692d8 --- /dev/null +++ b/privdata/relocate @@ -0,0 +1 @@ +.joeyconfig -- cgit v1.2.3 From a3719892565791715738cbf5acb6769d450fc6d5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 May 2016 14:51:07 -0400 Subject: add descriptions --- src/Propellor/Property/Attic.hs | 2 ++ src/Propellor/Property/Borg.hs | 2 ++ src/Propellor/Property/Obnam.hs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/Propellor/Property/Attic.hs b/src/Propellor/Property/Attic.hs index 26f23500..4415f8c0 100644 --- a/src/Propellor/Property/Attic.hs +++ b/src/Propellor/Property/Attic.hs @@ -1,4 +1,6 @@ -- | Maintainer: Félix Sipma +-- +-- Support for the Attic backup tool module Propellor.Property.Attic ( installed diff --git a/src/Propellor/Property/Borg.hs b/src/Propellor/Property/Borg.hs index e9abf2aa..f5842115 100644 --- a/src/Propellor/Property/Borg.hs +++ b/src/Propellor/Property/Borg.hs @@ -1,4 +1,6 @@ -- | Maintainer: Félix Sipma +-- +-- Support for the Borg backup tool module Propellor.Property.Borg ( installed diff --git a/src/Propellor/Property/Obnam.hs b/src/Propellor/Property/Obnam.hs index 6d6f4a7f..5bf3ff06 100644 --- a/src/Propellor/Property/Obnam.hs +++ b/src/Propellor/Property/Obnam.hs @@ -1,3 +1,5 @@ +-- | Support for the Obnam backup tool + module Propellor.Property.Obnam where import Propellor.Base -- cgit v1.2.3 From 2272bd612578592d714221f100d49163ec8b4389 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 May 2016 14:57:05 -0400 Subject: update --- doc/coding_style.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/coding_style.mdwn b/doc/coding_style.mdwn index 92553d76..bf127fe0 100644 --- a/doc/coding_style.mdwn +++ b/doc/coding_style.mdwn @@ -2,6 +2,20 @@ If you do nothing else, avoid use of partial functions from the Prelude! `import Utility.PartialPrelude` helps avoid this by defining conflicting functions for all the common ones. Also avoid `!!`, it's partial too. +The rest of this coding style is followed to keep the code in Propellor +consistent. You don't have to follow these rules in your own config.hs, or +in Propellor modules that you don't intend to get merged into mainstrain +Propellor. + +Start a module with a comment indicating what software it provides +properties for, and who maintains the module. + + -- | Maintainer: Your Name Here + -- + -- Support for the Foo daemon + + module Propellor.Property.Foo + Use tabs for indentation. Code should make sense with any tab stop setting, but 8 space tabs are -- cgit v1.2.3 From 49d25619436a1dc88790f7abdbff8bcbf0873326 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 May 2016 14:57:25 -0400 Subject: changelog --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 43931aae..1e70e46a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ propellor (3.0.4) UNRELEASED; urgency=medium * Run letsencrypt with --noninteractive. * Fix build with ghc 8.0.1-rc4. Thanks, davean. + * Module added for the Borg backup system. + Thanks, Félix Sipma. -- Joey Hess Thu, 05 May 2016 10:37:43 -0400 -- cgit v1.2.3 From 2348ba268106838b4d5e7432741c2a182d56a76b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 May 2016 14:57:29 -0400 Subject: clean up after merge --- config.hs | 2 +- privdata/relocate | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 privdata/relocate diff --git a/config.hs b/config.hs index 97d90636..ec313725 120000 --- a/config.hs +++ b/config.hs @@ -1 +1 @@ -joeyconfig.hs \ No newline at end of file +config-simple.hs \ No newline at end of file diff --git a/privdata/relocate b/privdata/relocate deleted file mode 100644 index 271692d8..00000000 --- a/privdata/relocate +++ /dev/null @@ -1 +0,0 @@ -.joeyconfig -- cgit v1.2.3 From bc9ab59f329124fde5c4b5733215bf556c53abbb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 17 May 2016 15:03:14 -0400 Subject: mention certbot --- src/Propellor/Property/LetsEncrypt.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Propellor/Property/LetsEncrypt.hs b/src/Propellor/Property/LetsEncrypt.hs index 88d4f5a8..592a1e1d 100644 --- a/src/Propellor/Property/LetsEncrypt.hs +++ b/src/Propellor/Property/LetsEncrypt.hs @@ -1,4 +1,5 @@ --- | This module uses the letsencrypt reference client. +-- | This module gets LetsEncrypt certificates +-- using CertBot module Propellor.Property.LetsEncrypt where @@ -7,6 +8,8 @@ import qualified Propellor.Property.Apt as Apt import System.Posix.Files +-- Not using the certbot name yet, until it reaches jessie-backports and +-- testing. installed :: Property DebianLike installed = Apt.installed ["letsencrypt"] -- cgit v1.2.3 From 3358fe355ac525d46588f21fc8360a4f78e636e2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 20 May 2016 23:29:20 -0400 Subject: remove commented out code --- src/Propellor/PropAccum.hs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Propellor/PropAccum.hs b/src/Propellor/PropAccum.hs index d9fa8ec7..fcac60bf 100644 --- a/src/Propellor/PropAccum.hs +++ b/src/Propellor/PropAccum.hs @@ -78,9 +78,3 @@ Props c &^ p = Props (toChildProperty p : c) -> RevertableProperty (MetaTypes y) (MetaTypes z) -> Props (MetaTypes (Combine x z)) Props c ! p = Props (c ++ [toChildProperty (revert p)]) - --- addPropsHost :: Host -> [Prop] -> Host --- addPropsHost (Host hn ps i) p = Host hn ps' i' --- where --- ps' = ps ++ [toChildProperty p] --- i' = i <> getInfoRecursive p -- cgit v1.2.3 From ba4f7cb05fd473d233206e360fe8b2e62b27796d Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sat, 21 May 2016 13:34:41 +0000 Subject: submit merge request --- doc/todo/merge_request:_Propellor.Property.Sbuild.mdwn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 doc/todo/merge_request:_Propellor.Property.Sbuild.mdwn diff --git a/doc/todo/merge_request:_Propellor.Property.Sbuild.mdwn b/doc/todo/merge_request:_Propellor.Property.Sbuild.mdwn new file mode 100644 index 00000000..3156fdb4 --- /dev/null +++ b/doc/todo/merge_request:_Propellor.Property.Sbuild.mdwn @@ -0,0 +1,18 @@ +Please consider merging branch `sbuild` of repository `https://git.spwhitton.name/propellor`. + +This branch adds the following features: + +- A new module `Propellor.Property.Sbuild` with properties for configuring sbuild schroots +- A new module `Propellor.Property.Schroot` with a property supporting those in `Propellor.Property.Sbuild` +- A new module `Propellor.Property.Ccache` with a property supporting those in `Propellor.Property.Sbuild` +- An export of `extractSuite` from `Propellor.Property.Debootstrap`, used in `Propellor.Property.Sbuild` +- Two new types of iptables matching rules in `Propellor.Property.Firewall`. + +The additions to `Propellor.Property.Firewall` were made to support `Sbuild.blockNetwork`, which is a hack from the Debian Wiki which doesn't seem to work with the latest version of sbuild. I left the additions to `Propellor.Property.Firewall` in my branch since they are probably independently useful. I left the `blockNetwork` property commented-out in `Sbuild.hs` in case I or someone else can make it work at a later date. + +I get the following strange warning from GHC thanks to my new export from `Propellor.Property.Debootstrap`. I can't figure out the problem and would be grateful for help. + + src/Propellor/Property/Debootstrap.hs:8:9: Warning: + `extractSuite' is exported by `extractSuite' and `extractSuite' + +--spwhitton -- cgit v1.2.3 From 02a25686e5159471afb942767d8896a42ada4a30 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 21 May 2016 13:08:42 -0400 Subject: followup --- .../comment_4_0e98f5ea8af2e14ead239e5b777afb26._comment | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/todo/spin_without_remote_compilation/comment_4_0e98f5ea8af2e14ead239e5b777afb26._comment diff --git a/doc/todo/spin_without_remote_compilation/comment_4_0e98f5ea8af2e14ead239e5b777afb26._comment b/doc/todo/spin_without_remote_compilation/comment_4_0e98f5ea8af2e14ead239e5b777afb26._comment new file mode 100644 index 00000000..28307a2d --- /dev/null +++ b/doc/todo/spin_without_remote_compilation/comment_4_0e98f5ea8af2e14ead239e5b777afb26._comment @@ -0,0 +1,14 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 4""" + date="2016-05-21T17:06:37Z" + content=""" +There's a patch implementing this now, in: + + https://git.gueux.org/propellor.git precompiled + +I have not found the increased memory too onerous, it's still working +down to 500 mb cheap VMs. So I'm looking for details about cases where +it causes ghc to use too much memory. + +"""]] -- cgit v1.2.3 From 127ebb05b4b5d4138aef017b1d0d87dd8680262b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 21 May 2016 13:34:39 -0400 Subject: todo --- doc/todo/use_ghc_8.0_custom_compile_errors.mdwn | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 doc/todo/use_ghc_8.0_custom_compile_errors.mdwn diff --git a/doc/todo/use_ghc_8.0_custom_compile_errors.mdwn b/doc/todo/use_ghc_8.0_custom_compile_errors.mdwn new file mode 100644 index 00000000..7eed443a --- /dev/null +++ b/doc/todo/use_ghc_8.0_custom_compile_errors.mdwn @@ -0,0 +1,27 @@ + + +This could be used in propellor to improve compile time errors. + +For example, a RevertableProperty is sometimes used where only a regular +Property is accepted. In this case, the error could suggest that the user +apply `setupRevertableProperty` to extract the setup side of the RevertableProperty. + +And, when a Property HasInfo is provided to ensureProperty, propellor could +explain, in the compile error, why it can't let the user do that. + +Custom errors need a type class to be used. So, could do something like this: + + class NeedsProperty a where + withProperty :: (Property metatype -> b) -> b + + instance NeedsProperty (Property metatype) where withProperty = id + + instance TypeError (Text "Use setupRevertableProperty ...") + => NeedsProperty RevertableProperty where + withProperty = error "unreachable" + +(While propellor needs to be buildable with older versions of ghc, +the `instance TypeError` can just be wrapped in an ifdef to make it only be +used by the new ghc.) + +[[!tag user/joey]] -- cgit v1.2.3 From 32a0a80777db7c1537f9f0f7c861c34c95ef58fa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 21 May 2016 14:04:55 -0400 Subject: review --- ...ent_1_b3343283b2d7d49ab70a95d762d0e081._comment | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 doc/todo/merge_request:_Propellor.Property.Sbuild/comment_1_b3343283b2d7d49ab70a95d762d0e081._comment diff --git a/doc/todo/merge_request:_Propellor.Property.Sbuild/comment_1_b3343283b2d7d49ab70a95d762d0e081._comment b/doc/todo/merge_request:_Propellor.Property.Sbuild/comment_1_b3343283b2d7d49ab70a95d762d0e081._comment new file mode 100644 index 00000000..89583ffc --- /dev/null +++ b/doc/todo/merge_request:_Propellor.Property.Sbuild/comment_1_b3343283b2d7d49ab70a95d762d0e081._comment @@ -0,0 +1,25 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-05-21T17:41:11Z" + content=""" +Re not running propellor in the sbuild chroot, I have in the past used +schroot for things where it would have made sense to run propellor +in the chroot. OTOH, systemd-container is a better fit for such uses cases +now, probably. + +Is the ~/.sbuildrc necessary to use the sbuild properties? If so, +would it make sense to have a property that configures it? + +You could use Utility.DataUnits for Ccache's MaxSize. This would be +more flexible and consistent with other things in propellor. + +Limit could be a monoid. This would perhaps simplify hasGroupCache +as it could only be used once to set multiple limits. + +Maybe instead of Ccache.hasGroupCache, call it Ccache.hasCache? + +That is a weird build warning! But, I don't see it with ghc 7.10.3. +Normally you'd see that warning when the module's export list exported the same +symbol twice. +"""]] -- cgit v1.2.3 From fe80b0157c0de7c2a2155e5d268b965c3a0f443d Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 22 May 2016 01:48:28 +0000 Subject: Added a comment --- ...ent_2_d8afe7b1fd49df5794c9abf2be732f8b._comment | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 doc/todo/merge_request:_Propellor.Property.Sbuild/comment_2_d8afe7b1fd49df5794c9abf2be732f8b._comment diff --git a/doc/todo/merge_request:_Propellor.Property.Sbuild/comment_2_d8afe7b1fd49df5794c9abf2be732f8b._comment b/doc/todo/merge_request:_Propellor.Property.Sbuild/comment_2_d8afe7b1fd49df5794c9abf2be732f8b._comment new file mode 100644 index 00000000..44a2a542 --- /dev/null +++ b/doc/todo/merge_request:_Propellor.Property.Sbuild/comment_2_d8afe7b1fd49df5794c9abf2be732f8b._comment @@ -0,0 +1,58 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 2" + date="2016-05-22T01:48:27Z" + content=""" +Thanks for your feedback. + +> Re not running propellor in the sbuild chroot, I have in the past used +> schroot for things where it would have made sense to run propellor in +> the chroot. OTOH, systemd-container is a better fit for such uses +> cases now, probably. + +I was thinking that if someone wanted to use a schroot and run +propellor in it, useful properties could be appended to +`Propellor.Property.Schroot`. As far as types go, I think that the +types in `Propellor.Property.Chroot` would be sufficient. + +> Is the ~/.sbuildrc necessary to use the sbuild properties? If so, +> would it make sense to have a property that configures it? + +The only probably which *needs* the suggested ~/.sbuildrc is +`Sbuild.piupartsConfFor`. With the other properties and no +~/.sbuildrc, you should be able to go ahead and use sbuild(1) to +perform a clean build. + +I don't think there is a way to write a non-intrusive property to add +anything to a user's ~/.sbuildrc. That's because they will probably +have different preferences for the options to pass to piuparts than I +give in the example, and we would have to merge the adt-run code with +any existing post-build-commands. I'm not sure propellor should have +a perl config file parser. + +> You could use Utility.DataUnits for Ccache's MaxSize. This would be +> more flexible and consistent with other things in propellor. + +Done. + +> Limit could be a monoid. This would perhaps simplify hasGroupCache as +> it could only be used once to set multiple limits. + +Done. + +> Maybe instead of Ccache.hasGroupCache, call it Ccache.hasCache? + +Done, I think that's better. I was originally thinking that the name +`Ccache.hasCache` might be for a property `User -> Property +DebianLike`. However, if someone wanted to write a property configuring +a user cache, it would probably have the standard location +`~/.ccache`. This cache would be implicitly created when required, so +the name `Ccache.hasCache` would be needed. + +> That is a weird build warning! But, I don't see it with ghc +> 7.10.3. Normally you'd see that warning when the module's export list +> exported the same symbol twice. + +I'm on GHC 7.10.3, too... + +"""]] -- cgit v1.2.3 From 65ac730c006184472a7d0cb19deffdd69839530f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 22 May 2016 13:55:42 -0400 Subject: comment --- .../comment_3_679468488a88f0a3f28ea0be548691a0._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/todo/merge_request:_Propellor.Property.Sbuild/comment_3_679468488a88f0a3f28ea0be548691a0._comment diff --git a/doc/todo/merge_request:_Propellor.Property.Sbuild/comment_3_679468488a88f0a3f28ea0be548691a0._comment b/doc/todo/merge_request:_Propellor.Property.Sbuild/comment_3_679468488a88f0a3f28ea0be548691a0._comment new file mode 100644 index 00000000..7d5da612 --- /dev/null +++ b/doc/todo/merge_request:_Propellor.Property.Sbuild/comment_3_679468488a88f0a3f28ea0be548691a0._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-05-22T17:53:42Z" + content=""" +Would it make sense to move the ~/.sbuildrc example into the documentation +for the property that uses it? +"""]] -- cgit v1.2.3 From af00ff05913441cd4860c66aaf1d7a20a55b6d76 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 22 May 2016 15:39:22 -0400 Subject: update ghc version; 8.0.1 is released --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1e70e46a..2092e784 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ propellor (3.0.4) UNRELEASED; urgency=medium * Run letsencrypt with --noninteractive. - * Fix build with ghc 8.0.1-rc4. + * Fix build with ghc 8.0.1. Thanks, davean. * Module added for the Borg backup system. Thanks, Félix Sipma. -- cgit v1.2.3 From 14e5429163f0138f03deaaa1134c8b4982c27141 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 22 May 2016 15:41:28 -0400 Subject: merge Utility from git-annex --- src/Utility/Exception.hs | 6 +++++- src/Utility/FileMode.hs | 3 ++- src/Utility/FileSystemEncoding.hs | 8 ++++++++ src/Utility/PosixFiles.hs | 10 +++++++++- src/Utility/Tmp.hs | 2 +- src/Utility/UserInfo.hs | 4 +--- 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/Utility/Exception.hs b/src/Utility/Exception.hs index 8b110ae6..e691f13b 100644 --- a/src/Utility/Exception.hs +++ b/src/Utility/Exception.hs @@ -21,7 +21,8 @@ module Utility.Exception ( tryNonAsync, tryWhenExists, catchIOErrorType, - IOErrorType(..) + IOErrorType(..), + catchPermissionDenied, ) where import Control.Monad.Catch as X hiding (Handler) @@ -97,3 +98,6 @@ catchIOErrorType errtype onmatchingerr a = catchIO a onlymatching onlymatching e | ioeGetErrorType e == errtype = onmatchingerr e | otherwise = throwM e + +catchPermissionDenied :: MonadCatch m => (IOException -> m a) -> m a -> m a +catchPermissionDenied = catchIOErrorType PermissionDenied diff --git a/src/Utility/FileMode.hs b/src/Utility/FileMode.hs index efef5fa2..bb3780c6 100644 --- a/src/Utility/FileMode.hs +++ b/src/Utility/FileMode.hs @@ -18,9 +18,10 @@ import System.PosixCompat.Types import Utility.PosixFiles #ifndef mingw32_HOST_OS import System.Posix.Files +import Control.Monad.IO.Class (liftIO) #endif +import Control.Monad.IO.Class (MonadIO) import Foreign (complement) -import Control.Monad.IO.Class (liftIO, MonadIO) import Control.Monad.Catch import Utility.Exception diff --git a/src/Utility/FileSystemEncoding.hs b/src/Utility/FileSystemEncoding.hs index 67341d37..eab98337 100644 --- a/src/Utility/FileSystemEncoding.hs +++ b/src/Utility/FileSystemEncoding.hs @@ -19,6 +19,7 @@ module Utility.FileSystemEncoding ( encodeW8NUL, decodeW8NUL, truncateFilePath, + setConsoleEncoding, ) where import qualified GHC.Foreign as GHC @@ -164,3 +165,10 @@ truncateFilePath n = reverse . go [] n . L8.fromString else go (c:coll) (cnt - x') (L8.drop 1 bs) _ -> coll #endif + +{- This avoids ghc's output layer crashing on invalid encoded characters in + - filenames when printing them out. -} +setConsoleEncoding :: IO () +setConsoleEncoding = do + fileEncoding stdout + fileEncoding stderr diff --git a/src/Utility/PosixFiles.hs b/src/Utility/PosixFiles.hs index 4550bebd..37253da2 100644 --- a/src/Utility/PosixFiles.hs +++ b/src/Utility/PosixFiles.hs @@ -1,6 +1,6 @@ {- POSIX files (and compatablity wrappers). - - - This is like System.PosixCompat.Files, except with a fixed rename. + - This is like System.PosixCompat.Files, but with a few fixes. - - Copyright 2014 Joey Hess - @@ -21,6 +21,7 @@ import System.PosixCompat.Files as X hiding (rename) import System.Posix.Files (rename) #else import qualified System.Win32.File as Win32 +import qualified System.Win32.HardLink as Win32 #endif {- System.PosixCompat.Files.rename on Windows calls renameFile, @@ -32,3 +33,10 @@ import qualified System.Win32.File as Win32 rename :: FilePath -> FilePath -> IO () rename src dest = Win32.moveFileEx src dest Win32.mOVEFILE_REPLACE_EXISTING #endif + +{- System.PosixCompat.Files.createLink throws an error, but windows + - does support hard links. -} +#ifdef mingw32_HOST_OS +createLink :: FilePath -> FilePath -> IO () +createLink = Win32.createHardLink +#endif diff --git a/src/Utility/Tmp.hs b/src/Utility/Tmp.hs index 7610f6cc..6a541cfe 100644 --- a/src/Utility/Tmp.hs +++ b/src/Utility/Tmp.hs @@ -11,9 +11,9 @@ module Utility.Tmp where import System.IO -import System.Directory import Control.Monad.IfElse import System.FilePath +import System.Directory import Control.Monad.IO.Class #ifndef mingw32_HOST_OS import System.Posix.Temp (mkdtemp) diff --git a/src/Utility/UserInfo.hs b/src/Utility/UserInfo.hs index 7e94cafa..c6010116 100644 --- a/src/Utility/UserInfo.hs +++ b/src/Utility/UserInfo.hs @@ -17,9 +17,7 @@ module Utility.UserInfo ( import Utility.Env import System.PosixCompat -#ifndef mingw32_HOST_OS import Control.Applicative -#endif import Prelude {- Current user's home directory. @@ -58,6 +56,6 @@ myVal envvars extract = go envvars #ifndef mingw32_HOST_OS go [] = extract <$> (getUserEntryForID =<< getEffectiveUserID) #else - go [] = error $ "environment not set: " ++ show envvars + go [] = extract <$> error ("environment not set: " ++ show envvars) #endif go (v:vs) = maybe (go vs) return =<< getEnv v -- cgit v1.2.3 From 0d9148d03cd40ddf9ae79fadd6571dd0fd576d5b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 22 May 2016 15:52:27 -0400 Subject: split out module to work around badly named symbol in directory-1.2.6.2 Sadly my bug report about this is not going to get fixed it seems, so I have to drag around a whole added module file just to deal with it. https://github.com/haskell/directory/issues/52 --- debian/changelog | 1 + propellor.cabal | 1 + src/Propellor/Base.hs | 4 ++-- src/Utility/Directory.hs | 6 +++--- src/Utility/SystemDirectory.hs | 16 ++++++++++++++++ 5 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 src/Utility/SystemDirectory.hs diff --git a/debian/changelog b/debian/changelog index 2092e784..137d9d75 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ propellor (3.0.4) UNRELEASED; urgency=medium Thanks, davean. * Module added for the Borg backup system. Thanks, Félix Sipma. + * Fix build with directory-1.2.6.2. -- Joey Hess Thu, 05 May 2016 10:37:43 -0400 diff --git a/propellor.cabal b/propellor.cabal index beac5c38..547f34a6 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -207,6 +207,7 @@ Library Utility.Process.NonConcurrent Utility.SafeCommand Utility.Scheduled + Utility.SystemDirectory Utility.Table Utility.ThreadScheduler Utility.Tmp diff --git a/src/Propellor/Base.hs b/src/Propellor/Base.hs index ef75bf03..ae75589f 100644 --- a/src/Propellor/Base.hs +++ b/src/Propellor/Base.hs @@ -20,7 +20,7 @@ module Propellor.Base ( , module Propellor.Utilities -- * System modules - , module System.Directory + , module Utility.SystemDirectory , module System.IO , module System.FilePath , module Data.Maybe @@ -47,7 +47,7 @@ import Propellor.PropAccum import Propellor.Location import Propellor.Utilities -import System.Directory hiding (isSymbolicLink) +import Utility.SystemDirectory import System.IO import System.FilePath import Data.Maybe diff --git a/src/Utility/Directory.hs b/src/Utility/Directory.hs index 3b12b9fc..693e7713 100644 --- a/src/Utility/Directory.hs +++ b/src/Utility/Directory.hs @@ -6,15 +6,14 @@ -} {-# LANGUAGE CPP #-} -{-# OPTIONS_GHC -fno-warn-tabs -w #-} +{-# OPTIONS_GHC -fno-warn-tabs #-} module Utility.Directory ( module Utility.Directory, - module System.Directory + module Utility.SystemDirectory ) where import System.IO.Error -import System.Directory hiding (isSymbolicLink) import Control.Monad import System.FilePath import Control.Applicative @@ -31,6 +30,7 @@ import Utility.SafeCommand import Control.Monad.IfElse #endif +import Utility.SystemDirectory import Utility.PosixFiles import Utility.Tmp import Utility.Exception diff --git a/src/Utility/SystemDirectory.hs b/src/Utility/SystemDirectory.hs new file mode 100644 index 00000000..3dd44d19 --- /dev/null +++ b/src/Utility/SystemDirectory.hs @@ -0,0 +1,16 @@ +{- System.Directory without its conflicting isSymbolicLink + - + - Copyright 2016 Joey Hess + - + - License: BSD-2-clause + -} + +-- Disable warnings because only some versions of System.Directory export +-- isSymbolicLink. +{-# OPTIONS_GHC -fno-warn-tabs -w #-} + +module Utility.SystemDirectory ( + module System.Directory +) where + +import System.Directory hiding (isSymbolicLink) -- cgit v1.2.3 From 0dd63693b8938a1d9a1319811b3d8bdd1569c60f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 22 May 2016 15:55:08 -0400 Subject: prep release --- debian/changelog | 4 ++-- propellor.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 137d9d75..261989c2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -propellor (3.0.4) UNRELEASED; urgency=medium +propellor (3.0.4) unstable; urgency=medium * Run letsencrypt with --noninteractive. * Fix build with ghc 8.0.1. @@ -7,7 +7,7 @@ propellor (3.0.4) UNRELEASED; urgency=medium Thanks, Félix Sipma. * Fix build with directory-1.2.6.2. - -- Joey Hess Thu, 05 May 2016 10:37:43 -0400 + -- Joey Hess Sun, 22 May 2016 15:54:49 -0400 propellor (3.0.3) unstable; urgency=medium diff --git a/propellor.cabal b/propellor.cabal index 547f34a6..e6279aef 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -1,5 +1,5 @@ Name: propellor -Version: 3.0.3 +Version: 3.0.4 Cabal-Version: >= 1.8 License: BSD2 Maintainer: Joey Hess -- cgit v1.2.3 From 23c0efee2ebf3575840e75af115a782cb447dd87 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 22 May 2016 16:05:15 -0400 Subject: bump standards-version --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 898e558d..9194b6c2 100644 --- a/debian/control +++ b/debian/control @@ -20,7 +20,7 @@ Build-Depends: libghc-text-dev, libghc-concurrent-output-dev, Maintainer: Joey Hess -Standards-Version: 3.9.6 +Standards-Version: 3.9.8 Vcs-Git: git://git.joeyh.name/propellor Homepage: http://propellor.branchable.com/ -- cgit v1.2.3