| Age | Commit message (Collapse) | Author |
|
|
|
|
|
This commit was sponsored by Ethan Aubin.
|
|
destination file did not yet exist.
This commit was sponsored by andrea rota.
|
|
f' normally means a later version of f
|
|
* Propellor.Property.XFCE added with some useful properties for the
desktop environment.
* Added File.applyPath property.
This commit was sponsored by Riku Voipio.
|
|
* Added ConfigurableValue type class, for values that can be used in a
config file, or to otherwise configure a program.
* The val function converts such values to String.
This was motivated by the bug caused by type Port = Int changing to
newtype Port = Port Int deriving Show
After that change, some things that used show port to generate config
files were broken. By using the ConfigurableValue type class instead,
such breakage can be prevented.
|
|
|
|
|
|
|
|
generate good filenames for config directories.
spwhitton has a branch that could use this, and there are several places
in propellor that do something ad-hoc that would have been better
implemented using this. I was not able to switch any of the existing
ad-hoc stuff, but this can be used going forward for new stuff.
This commit was sponsored by Anthony DeRobertis on Patreon.
|
|
|
|
|
|
|
|
|
|
|
|
lines, or a ByteString.
|
|
https://propellor.branchable.com/todo/bytes_in_privData__63__/
|
|
|
|
Moved to its own module to keep everything related in one place.
|
|
A few parts using ensureProperty need more work to compile
|
|
|
|
modified the locale.gen file and sometimes caused the property to need to make changes every time.
|
|
|
|
* Properties that run an arbitrary command, such as cmdProperty
and scriptProperty are converted to use UncheckedProperty, since
they cannot tell on their own if the command truely made a change or not.
(API Change)
Transition guide:
- When GHC complains about an UncheckedProperty, add:
`assume` MadeChange
- Since these properties used to always return MadeChange, that
change is always safe to make.
- Or, if you know that the command should modifiy a file, use:
`changesFile` filename
* A few properties have had their Result improved, for example
Apt.buldDep and Apt.autoRemove now check if a change was made or not.
|
|
Signed-off-by: Per Olofsson <pelle@dsv.su.se>
|
|
Signed-off-by: Per Olofsson <pelle@dsv.su.se>
|
|
And use when reverting conductor property.
Note that I didn't convert existing ssh properties to RevertablePropery
because the API change was too annoying to work through.
|
|
Something about making symlinks is very confusing about which parameter is
which. It perhaps doesn't help that isSymlinkedTo has the target second,
while ln has it first. Let's use a type to prevent confusion.
Also, simplified some properties that now use isSymlinkedTo. Since
isSymlinkedTo checks the link target, these properties don't need to check
themselves that the link is in place.
|
|
|
|
via origfile.propellor-new~, instead of to a randomly named temp file.
This allows them to clean up any temp file that may have been left by an
interrupted run of propellor.
Also converted the new isSymlinkedTo property to use the same
implementation, with some simplifications.
|
|
|
|
Signed-off-by: Per Olofsson <pelle@dsv.su.se>
|
|
|
|
mode to start with
|
|
* PrivData converted to newtype (API change).
* Stopped stripping trailing newlines when setting PrivData;
this was previously done to avoid mistakes when pasting eg passwords
with an unwanted newline. Instead, PrivData consumers should use either
privDataLines or privDataVal, to extract respectively lines or a
value (without internal newlines) from PrivData.
|
|
|
|
|
|
|
|
thanks, gueux
|
|
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.
|
|
|
|
* 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.
|
|
|
|
|
|
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"]
|
|
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.
|
|
file to sometimes be appended to the end.
|
|
Avoid locking down and then lossening the file mode; just use the
default/current mode from the beginning.
|
|
|