summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog2
-rw-r--r--doc/forum/Supported_OS/comment_1_f324bed708305e2667bd00f80544dd90._comment4
-rw-r--r--src/Propellor/EnsureProperty.hs2
-rw-r--r--src/Propellor/Property.hs3
4 files changed, 7 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index f337b640..8bff519b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,8 @@ propellor (5.6.0) UNRELEASED; urgency=medium
* When bootstrapping on Debian, libghc-stm-dev may not be available,
as it's become part of ghc, so check before trying to install it.
* Fix build with ghc 8.6.3.
+ * Avoid exposing the constructor of OuterMetaTypesWitness, to avoid
+ the kind of mistake that led to the withOS bug.
* Merged Utility changes from git-annex.
-- Joey Hess <id@joeyh.name> Tue, 23 Oct 2018 11:37:16 -0400
diff --git a/doc/forum/Supported_OS/comment_1_f324bed708305e2667bd00f80544dd90._comment b/doc/forum/Supported_OS/comment_1_f324bed708305e2667bd00f80544dd90._comment
index 4869922e..84aad7f3 100644
--- a/doc/forum/Supported_OS/comment_1_f324bed708305e2667bd00f80544dd90._comment
+++ b/doc/forum/Supported_OS/comment_1_f324bed708305e2667bd00f80544dd90._comment
@@ -22,8 +22,8 @@ on multiple OS's:
upgraded :: Property (DebianLike + FreeBSD)
upgraded = Apt.upgraded `pickOS` Pkg.upgraded
-The `withOS` function lets a single property do different things for
-different OS versions as well as different OS's.
+The `pickOS` function lets a single property do different things for
+different OS's.
The ArchLinux and FreeBSD ports were done by propellor users,
and both are good examples of the scope of the changes involved in making
diff --git a/src/Propellor/EnsureProperty.hs b/src/Propellor/EnsureProperty.hs
index 6c720e2b..ab624706 100644
--- a/src/Propellor/EnsureProperty.hs
+++ b/src/Propellor/EnsureProperty.hs
@@ -7,7 +7,7 @@
module Propellor.EnsureProperty
( ensureProperty
, property'
- , OuterMetaTypesWitness(..)
+ , OuterMetaTypesWitness
, Cannot_ensureProperty_WithInfo
) where
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index cb2f01a8..54dd8908 100644
--- a/src/Propellor/Property.hs
+++ b/src/Propellor/Property.hs
@@ -303,7 +303,8 @@ pickOS a b = c `addChildren` [toChildProperty a, toChildProperty b]
where
-- This use of getSatisfy is safe, because both a and b
-- are added as children, so their info will propigate.
- c = withOS (getDesc a) $ \_ o ->
+ c = property (getDesc a) $ do
+ o <- getOS
if matching o a
then maybe (pure NoChange) id (getSatisfy a)
else if matching o b