Commit Graph

12 Commits

Author SHA1 Message Date
Joey Hess 89b6629464 fix type signature, filepath and string params were flipped
thanks, gueux
2015-04-23 09:24:23 -04:00
Joey Hess f35ef9d697 API change: Added User and Group newtypes, and Properties that used to use the type UserName = String were changed to use them.
Note that UserName is kept and PrivData still uses it in its sum type.
This is to avoid breaking PrivData serialization.
2015-04-22 13:04:39 -04:00
Joey Hess d7697a4b25
propellor spin 2015-01-29 01:04:59 -04:00
Joey Hess 0ee04ecc43 GADT properties seem to work (untested)
* Property has been converted to a GADT, and will be Property NoInfo
  or Property HasInfo.
  This was done to make sure that ensureProperty is only used on
  properties that do not have Info.
  Transition guide:
  - Change all "Property" to "Property NoInfo" or "Property WithInfo"
    (The compiler can tell you if you got it wrong!)
  - To construct a RevertableProperty, it is useful to use the new
    (<!>) operator
  - Constructing a list of properties can be problimatic, since
    Property NoInto and Property WithInfo are different types and cannot
    appear in the same list. To deal with this, "props" has been added,
    and can built up a list of properties of different types,
    using the same (&) and (!) operators that are used to build
    up a host's properties.
2015-01-24 22:38:51 -04:00
Joey Hess 932cb7c5d6 add hasPrivContentFrom 2015-01-03 19:07:59 -04:00
Joey Hess 23399416f1 broke up big function to describe PrivDataField 2014-12-14 16:14:05 -04:00
Joey Hess f8943c2036 fix a case where fileProperty reported a change despite not making one
The problem occurred because two lists of lines of the file can be
different, while representing the same file content. For example:
["foo", "bar"]
["foo\nbar"]
2014-12-09 00:30:04 -04:00
Joey Hess 9ca332e481 Fixed privdata introspection for User.hasPassword and User.hasSomePassword
This is not a complete fix for the problem that Info doen't propigate
from the called property when code does something like:

	do
		hostname <- asks hostName
		ensureProperty $ foo hostname

Instead, I just eliminated the need to implement hasPassword that way,
by making the PrivData Info use a HostContext which automatically
gets the right hostname passed to it.

All other uses of withPrivData don't have the problem. It's still possible
for the user to run into the problem if they write something like the
above, where foo is a property that uses privdata. However, all properties
that take a Context now also accept a HostContext, so it's at least less
likely the user needs to write that.
2014-12-07 15:03:06 -04:00
Joey Hess 55a638ad4c Fix bug in File.containsLines that caused lines that were already in the file to sometimes be appended to the end. 2014-07-17 23:33:10 -04:00
Joey Hess cfb758d655 better hasPrivContentExposed
Avoid locking down and then lossening the file mode; just use the
default/current mode from the beginning.
2014-07-17 22:35:59 -04:00
Joey Hess 58f79c12aa
propellor spin 2014-07-06 15:56:56 -04:00
Joey Hess 7115d1ec16 moved source code to src
This is to work around OSX's brain-damange regarding filename case
insensitivity.

Avoided moving config.hs, because it's a config file. Put in a symlink to
make build work.
2014-05-14 19:41:05 -04:00