When checking for lxc configuration that should be removed, it says to
grep to use extended regular expressions (ERE). But there are no
characters not covered by basic regular expressions (BRE). So switching
to to BRE, as it may not match user input as regex.
This parameter restarts the container if configuration changes and it is
already running and should keept running. It handles the freeze state,
because it would be expected to apply changes in this state, too.
When a container is created, the configuration is unknown to the
explorer. To do the job without the knowleage, following is added: If
the container will be created, it adds all absent configuration options
to be deleted. Because it do not know which configuration options exist,
it tries to remove all if there exists.
This behaviour is extended for containers that will be cloned: Because
the container who will be cloned is known and it will copy the config
nearly one to one, so it will read this configuration.
The removal of configuration is generally improved by generating a
pattern to ignore spaces at the beginning, near the equal sign and at
the end. This deletes the correct configuration lines even they have
malformed whitespaces.
Rather than the config handling is split up over gencode-{local,remote}
and the manifest, it is now completly moved to the gencode-remote script.
This avoids complexity, file uploading and direct ssh interactions as it
was used before. The diff creation was extracted into an extra script, and
the gencode-local was removed.
Now, the gencode-remote script executes the config diff script before
the short curcuit and uses here-documents and pipes if the diff is
required on the remote host. With this, the script size grows, but
should be no difference if the file is downloaded temporarily.
With this, the remote handling of an empty configuration file was
enhanced by handling it completely into the code-remote script (hope
escaping works correctly).
To the error in the `explorer/state`: It's intended, as it passes
possible parameters to the command. Varibale will set unquoted, so
word splitting take action, but the quotes inside the variable work.
Helper scripts do not work with explorers, so there are useless; and
some other problems detected at runtime.
`gencode-remote` *will be refactored - be aware*
noclobber is potentially unsafe, because it relies on the underlying shell to
implement noclobber in a safe way that avoids race conditions between multiple
processes.
mkdir is safer because it is mandated by POSIX to "fail" if the target already
exists.
Instead, rely on `nonparallel`.
In any case cdist should never run explorer and code concurrently even if the
dependency graph would allow to do so as it would result in many more
synchronization issues than this one.